Ask Experts Questions for FREE Help !
Ask
    trungsonqlkd's Avatar
    trungsonqlkd Posts: 2, Reputation: 1
    New Member
     
    #1

    Aug 24, 2006, 12:34 AM
    I am very needing yours about asp
    Hi,
    I am VIetnammes I am studying informatic technonogy. I am studying 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("product.asp?productid=<%= rscatlist(")%>"><%=rscatlist(")%>")%></a>
    <br>
    <%
    rscatlist.movenext
    wend
    end if
    %>
    </td>

    <td>
    <% = rsprod("name") %>
    </td>

    <td width=180 align="image">
    <font size="left" face="3" color="helvetica">
    <b><%= rsprod("<%= text %>") %></b>
    <br>
    <table width=180 border=0>
    <tr>
    <td align="name">
    <font size="left" face="2" color="helvetica">
    <b>Price:</b>
    </td>
    <td align="<%= COLdark %>">
    <font size="right" face="2" color="helvetica">
    <% if rsprod("saleprice"<%= text %>"" or rsprod("saleprice")=0 then %>
    <% =cursymbol & formatnumber(rsprod("price" or rsprod("price")) %>
    </strike>
    </tr>
    <tr>
    </td>
    <td><font size=")=0 then %>
    <% =cursymbol & formatnumber(rsprod(" face=")) %>
    <% else %>
    <strike>
    <% =cursymbol & formatnumber(rsprod(" color="<%= COLsale %>">
    Sale Price:
    </td>
    <td align=")) %>
    </strike>
    </tr>
    <tr>
    </td>
    <td><font size=">
    <font size=" face=" face=" color=" color="<%= COLsale %>">
    <b><% =cursymbol & formatnumber(rsprod(">
    Sale Price:
    </td>
    <td align=")) %></b>
    <font size=">
    <font size=" face=" face=" color=" color=">
    <% end if %>

    </td>
    </tr>
    </table>
    <br>


    <font size=">
    <b><% =cursymbol & formatnumber(rsprod(">
    <%= rsprod("description")) %></b>
    <font size="addprod.asp?productid=<%= rsprod(" face=")%>" color="https://www.askmehelpdesk.com/images/purchase.gif" border=0></a>
    <% if not(WISHLIST_element(rsprod(">
    <% end if %>

    </td>
    </tr>
    </table>
    <br>


    <font size="))) then %>
    <br>
    <a href="product.asp?productid=<%= rsprod(">
    <%= rsprod(")%>&wish=add") %>
    <br><br>
    <center>
    <a href="https://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("productid") because SQL inner join don' runt
    I think this Stament is fasle...

    I thank who can help me?
    trungsonqlkd's Avatar
    trungsonqlkd Posts: 2, Reputation: 1
    New Member
     
    #2

    Aug 24, 2006, 12:46 AM
    Error in INNER JOIN..
    http://www.alanward.net/acart/acart20.asp

    I downloald this shooping cart but it don't run.
    I want help
    I code error in SQL that have inner jion

    You try down and find error help me
    Thank you.
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #3

    Aug 24, 2006, 05:50 AM
    What database are you running in the back end? If you are going against an Access (Jet) database then you may need to close your SQL statements with a ; like so:

    SELECT * FROM products INNER JOIN categories ON products.catcode = categories.catcode WHERE products.productid = " & productid & ";"

    Also, have you tried testing your queries directly to make sure the SQL works and the right records arer returned?

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Needing help // advice. [ 9 Answers ]

So.. Im 18 now, male.. and wanting to have a more serios meaningful relationship. Problem? I've been single for a couple years now and seem to be deemed permanently single :| I'm just having no luck at all. I'm one of the few who's not just in it for a one night thing, and actually like getting...

Needing Some Magic (in the Cream etc.) [ 3 Answers ]

I posted earlier on my chameleon-like ability to change skin color depending on temperature. Cold=fair, Hot=Tan Well, I've been using some really Bureau of Food and Drug-approved magic creams and glutathione pills, plus undergoing some really serious pampering at the spa and salon -- body scrubs...

Needing a little hope/help [ 13 Answers ]

My boyfriend of 1.5 years just told me he is deciding whether to dump me. We are graduating college this year and were planning on going to grad school next year and live together, etc. I'm in so much pain, this decision is taking weeks and it is draining me of everything- I can't eat sleep or...

Needing an answer [ 4 Answers ]

I dated a man for 16 years and for the past 6 years, we had maintained a long distance relationship. He now says that he does not think it is going to work and I have not talked to him in 4 weeks. I was born May 12th 1953. Can you tell me my future with or without him

Needing Direction [ 1 Answers ]

I am looking for direction in my life. Points or interest are as follows... Marriage Children Job Health Family


View more questions Search