VP-ASP :: Shopping Cart Software

Shopping Cart Software Solutions for anywhere in the World

US/Canada(Toll Free): +1 888 587 2278
Europe/UK: +44 (020) 7193 9408
Australia/New Zealand: +61 3 9016 4497

VP-ASP Shopping Cart Customer Forum

Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VPCart Forum
 Add-ons for VP-ASP
 HELP! HELP! NEED HELP! PLEASE HELP!!
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

lbasra
Starting Member

USA
7 Posts

Posted - February 21 2007 :  01:24:36  Show Profile  Visit lbasra's Homepage  Reply with Quote
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

devshb
Senior Member

United Kingdom
1898 Posts

Posted - February 21 2007 :  05:10:38  Show Profile  Visit devshb's Homepage  Reply with Quote
try using:
DISTINCTROW

instead of
DISTINCT

in those sql statements

Simon Barnaby
Developer
[email protected]
www.BigYellowZone.com
Web Design, Online Marketing and VPASP addons
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000