lbasra
Starting Member
USA
7 Posts |
Posted - February 21 2007 : 01:24:36
|
I need help with VPASP - to SHOW brands by category
Sub Shopbybrand()
If getconfig("xlogonrequired")="Yes" then If getsess("login")="" then exit sub end if end if If getconfig("init")="" then exit sub dim cid, name,catSQL,i
dim strmanufacturer, mancount, manufacturers
Dim catdbc,catrs, hassubcategory,mylink
'mancount=getsess("mancount") If mancount="" then mancount=0 If xusefilesession="Yes" then mancount=0 end if If mancount=0 then mancount=0 redim manufacturers(100) ShopOpenDatabaseP catdbc If not catdbc.state=adStateOpen then shopclosedatabase catdbc exit sub end if
'catSQL="SELECT DISTINCT Products.mfg FROM categories RIGHT JOIN Products ON categories.categoryid = Products.ccategory WHERE categories.categoryid = " & CAT_ID
catsql="SELECT DISTINCT products.mfg FROM products INNER JOIN categories ON products.ccategory = categories.categoryid WHERE categories.categoryid="& CAT_ID
'catSQL="Select Distinct mfg from products WHERE hide=0 Order By Mfg ASC" set catrs=catdbc.execute(catsql) %> <select name="Value" style="font-size:8pt"> <OPTION VALUE="Select Manufacturer" selected>Select Manufacturer</option>
<% While Not catrs.EOF name=catrs("Mfg") 'cid=catrs("categoryid")
if Trim(name)<>"" then %> mylink="<a HREF=""shopquery.asp?Mfg="& name & """</a>" & name <OPTION VALUE="shopquery.asp?mfg<%= catrs("mfg") %>"><%= catrs("mfg") %></option></a><% end if manufacturers(mancount)=mylink mancount=mancount+1 catrs.MoveNext Wend setsessa "manufacturers",manufacturers setsess "mancount",mancount catrs.Close set catrs=nothing ShopCloseDatabase catdbc end if ' mancount=getsess("mancount") manufacturers=getsessa("manufacturers") %><table border=0 cellpadding=0 cellspacing=0 width="100%"><% for i = 0 to mancount-1 mylink=manufacturers(i) %><tr valign='top'><td class=leftmenumain><% response.write mylink %></td></tr><% next %></table><%
end sub
When i go to Quick Search and type something in i get this message.
but When I type something at QuickSearch Option I get this message: [MySQL][ODBC 3.51 Driver][mysqld-4.1.22-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Please HELP!!!
NEED HELP
tony |
|