| I am very needing yours about asp Hi,
I am VIetnammes i am studying informatic technonogy. I am studing shopping cart, I downed this demo ones is acart2_0 , but i have problem in error.
In eacht pages that have SQL inner join that it don't run
this code example
<%@ LANGUAGE = "VBScript" %>
<!-- #include file="db.asp" -->
<!-- #include file="config.asp" -->
<!-- #include file="functions.asp" -->
<!-- #include file="wishlist.asp" -->
<%
productid=valid_sql(request.querystring("productid "))
if productid=null or productid="" or not(isnumeric(productid)) then
response.redirect("error.asp?msg=" & Server.URLEncode("We have no record of the product you are looking for."))
end if
'get the relevant products details
set rsprod=db.execute("SELECT * FROM products INNER JOIN categories ON products.catcode = categories.catcode WHERE products.productid = " & productid)
if rsprod.eof then
response.redirect("error.asp?msg=" & Server.URLEncode("We have no record of the product you are looking for."))
end if
if request.querystring("wish")="add" then
WISHLIST_add(productid)
end if 'get names and codes of all products in that category
set rscatlist=db.execute("select name,productid from products where catcode=" & rsprod("catcode") & " order by name")
%>
<html>
<head>
<title>
<%= storename %>
</title>
<body bgcolor="<%= bgcolor %>" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" text="<%= text %>" alink="<%= COLlight %>" link="<%= COLlight %>" vlink="<%= vlink %>">
<font face="arial">
<%
header
categorymenu
%>
<table>
<td valign=top align=right>
<font face="helvetica" size="3" color="<%= COLdark %>"><B><%= rsprod("catname") %></B></font>
<br>
<%
'Display list of other products in category
if not rscatlist.eof then
rscatlist.movefirst
while not rscatlist.eof
%>
<font size="1" face="helvetica" color="<%= COLlight %>">
<a href="product.asp?productid=<%= rscatlist("productid")%>"><%=rscatlist("name")%></a>
<br>
<%
rscatlist.movenext
wend
end if
%>
</td>
<td>
<% = rsprod("image") %>
</td>
<td width=180 align="left">
<font size="3" face="helvetica" color="<%= text %>">
<b><%= rsprod("name") %></b>
<br>
<table width=180 border=0>
<tr>
<td align="left">
<font size="2" face="helvetica" color="<%= COLdark %>">
<b>Price:</b>
</td>
<td align="right">
<font size="2" face="helvetica" color="<%= text %>">
<% if rsprod("saleprice")="" or rsprod("saleprice")=0 then %>
<% =cursymbol & formatnumber(rsprod("price")) %>
<% else %>
<strike>
<% =cursymbol & formatnumber(rsprod("price")) %>
</strike>
</tr>
<tr>
</td>
<td><font size="2" face="helvetica" color="<%= COLsale %>">
Sale Price:
</td>
<td align="right">
<font size="2" face="helvetica" color="<%= COLsale %>">
<b><% =cursymbol & formatnumber(rsprod("saleprice")) %></b>
<font size="2" face="helvetica" color="<%= text %>">
<% end if %>
</td>
</tr>
</table>
<br>
<font size="1">
<%= rsprod("description") %>
<br><br>
<center>
<a href="addprod.asp?productid=<%= rsprod("productid")%>"><img src="http://www.askmehelpdesk.com/images/purchase.gif" border=0></a>
<% if not(WISHLIST_element(rsprod("productid"))) then %>
<br>
<a href="product.asp?productid=<%= rsprod("productid")%>&wish=add"><img src="http://www.askmehelpdesk.com/images/addwish.gif" border=0></a>
<% end if %>
</td>
</table>
<% footer %> </font>
</body>
</html>
<%
db.close
set db=nothing
%>
----------------------
while run it have error in row : set rscatlist=db.execute("select name,productid from products where catcode=" & rsprod("catcode") & " order by name")
-------------------------
i think it don't run in : &rsprod("cacode") because SQL inner join don' runt
i think this Stament is fasle...
i thank who can help me? |