lbasra
Starting Member
USA
7 Posts |
Posted - February 22 2007 : 04:44:36
|
Sub shopbybrand ' All russ's code starts here: Dim Mfgset,sqlstr,myconn,strMfgline,rs
'dim strdistinct 'strdistinct="DISTINCT" 'if UCASE(xdatabasetype)="SQLSERVER" or ucase(getconfig("xdatabasetype"))="SQLSERVER" then ' strdistinct="DISTINCT" 'end if
'dim tcategory, tproductname 'catalogid=cleancharsint(catalogid) cat_id=cleancharsint(cat_Id) 'tcategory=cleanchars(category) 'tproductname=cleanchars(productname) ' ShopOpenDatabaseP myconn
if cat_id="" then exit sub Set rs=myconn.execute("select DISTINCT mfg from products p, categories c where c.categoryid=p.ccategory and c.categoryid=" & CAT_ID )
'Set rs = myconn.execute("SELECT DISTINCT Products.mfg FROM categories INNER JOIN Products ON categories.categoryid = Products.ccategory WHERE Products.ccategory="& CAT_ID) 'c.categoryid ") 'if cat_id <> "" then ' Set rs=myconn.execute("select " & strdistinct & " mfg from products p, prodcategories cc, categories c where cc.intcatalogid=p.catalogid and cc.intcategoryid = " & cat_id ) 'else ' if catalogid<>"" then 'Set rs=myconn.execute("select " & strdistinct & " mfg from products p, prodcategories cc, categories c where cc.intcatalogid=p.catalogid and p.catalogid = " & catalogid ) ' Set rs=myconn.execute("select " & strdistinct & " mfg from products p, prodcategories cc, categories c where cc.intcatalogid=p.catalogid and cc.intcategoryid = " & cat_id ) 'end if 'end if
'Set rs = myconn.Execute("SELECT distinct ucase(mfg) as mfg from products where mfg is not null order by ucase(mfg)") 'ucase for access %> </font></font> <font size="1" face="Verdana, Arial, Helvetica, sans-serif"> <form name="form1"> <select name="menu1" onChange="MM_jumpMenu('parent',this,0)" style="font-size:12pt"> <OPTION VALUE="Select Manufacturer" selected>Search by Brand</option>
<% Do While Not rs.EOF if rs("mfg")<>"" then %> <!--OPTION VALUE="shopquery.asp?mfg=<%= rs("mfg") %>"><%= rs("mfg") %> </option--> <OPTION VALUE="shopquery.asp?cname=<%= rs("mfg") %>"><%=rs("mfg") %></option>
<% end if
rs.MoveNext %> <% Loop %> </SELECT> </form> </font> <%rs.Close myconn.Close Set rs = Nothing Set myconn = Nothing ' all russ's code ends here End Sub
I am stuck @ shopquery.asp?
I need to show by mfg for that particular category only.
when i use shopquery.asp?mfg=<%=rs("mfg")%> i get all the mfg .
But i need only for that ccategory and the mfg NAME TO SHOW UP
PLEASE HELP
SORRY FOR ANY INCONVIENCE... and the spelling.....
tony |
|