AddToCart insætte i db
hej jeg ved at lave en lille webshop dertil kunne jeg godt bruge noget hjælp.Mit problem er at jeg får en fejl når jeg prøver at instætte noget ind i en sql database.
jeg for dene fejlmedelse.
Fejltype:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E31)
Column count doesn't match value count at row 1
/codex-webshop/include/cases.asp, line 203
her har i koden problemet er i den liner hvor jeg indsætter i databasen
<%
case "AddToCart"
id = request.QueryString("id")
pris = replace(Request.QueryString("pris"),",",".")
antal = Request.Form("antal")
tsize = Request.Form("intsize")
If antal = "" Then
Response.Redirect Request.ServerVariables("HTTP_REFERER")
End If
If antal > 0 Then
sqlc = "select * from orders where sid="&session.SessionID&" and produktid="&id&" and size_id="&tsize&" and order_sent=0"
set rsA = conn.execute(sqlc)
sqlV = "select * from produkter where pid="&id&""
set rsV = conn.execute(sqlV)
nypris = rsV("pprice") * antal
If rsA.BOF Then
sqlws = "insert into orders (sid,amount,produktid,price,size_id) values ("&""&Session.SessionID&","&antal&","&id&","&Replace(nypris,",",".")&tsize&")"
set rsC = conn.execute(sqlws)
Else
nytantal = rsA("amount") + antal
nypris = rsV("pprice") * nytantal
sqlw = "update orders set amount="&nytantal&",price="&replace(nypris,",",".")&" where sid="&Session.SessionID&" and produktid="&id&""
conn.execute(sqlw)
End If
Elseif antal = 0 Then
sqldel = "delete from orders where sid="&Session.SessionID&" and produktid="&id&" and order_sent=0"
conn.execute(sqldel)
End If
Response.Redirect Request.ServerVariables("HTTP_REFERER")
%>