|
ianb -> seperate records for each item (6/15/2006 6:10:04)
|
ok, ive searched and search but nothing. im busy setting up a shopping cart, but at the end when the person is suppoed to check out and the items ordred are put into the database there is where i have the problem. The items get submitted to the DB, but not in its own row, the items are all in one row seperated by commas e.g. ItemQuantity1, Itemquantity2 | item 1, item2 and not like this: ItemQuantity1 | item1 ItemQuantity2 | item2 here is the code that processes the form: !--#include file="../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="insert into OrdersConfirmed (UID, quantity, product) values ( '::UID::', '::quantity::', '::product::')"
fp_sDefault="UID=&quantity=&product="
fp_sNoRecords="No records returned."
fp_sDataConn="scart"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&"
fp_iDisplayCols=16
fp_fCustomQuery=True
BOTID=2
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1.inc"-->
<p>
<!--webbot bot="PurpleText" PREVIEW="inserts the order details" --></p>
<!--#include file="../_fpclass/fpdbrgn2.inc"-->
</body></html> here is the form that sends to above:
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<% ' FP_ASP -- ASP Automatically generated by a Frontpage Component. Do not Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title></title>
</head>
<body>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="95%" id="AutoNumber4">
<tr>
<td width="100%"><font face="Verdana" size="2"><b>Order:</b></font><form method="POST" action="processorder.asp">
<div align="center">
<center>
<table width="95%" border="0" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0">
<thead>
<tr>
<td><b>Quantity</b></td>
<td><b>Product</b></td>
<td><b>Unit Price</b></td>
<td><b>Line Total</b></td>
</tr>
</thead>
<tbody>
<!--webbot bot="DatabaseRegionStart" s-columnnames="UID,orderID,productID,ProductPrice,ProductName,quantity" s-columntypes="202,3,2,202,202,2" s-dataconnection="scart" b-tableformat="TRUE" b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE" s-recordsource="itemsOrdered" s-displaycolumns="UID,orderID,productID,ProductPrice,ProductName,quantity" s-criteria="[UID] EQ {UID} +" s-order s-sql="SELECT * FROM itemsOrdered WHERE (UID = '::UID::')" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields="UID=" s-norecordsfound="No records returned." i-maxrecords="256" i-groupsize="0" botid="2" u-dblib="../_fpclass/fpdblib.inc" u-dbrgn1="../_fpclass/fpdbrgn1.inc" u-dbrgn2="../_fpclass/fpdbrgn2.inc" tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" align="left" width="100%"><font color="#000000">This is the start of a Database Results region.</font></td></tr>" startspan --><!--#include file="../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM itemsOrdered WHERE (UID = '::UID::')"
fp_sDefault="UID="
fp_sNoRecords="<tr><td colspan=6 align=left width=""100%"">No records returned.</td></tr>"
fp_sDataConn="scart"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&UID=202&orderID=3&productID=2&ProductPrice=202&ProductName=202&quantity=2&"
fp_iDisplayCols=6
fp_fCustomQuery=False
BOTID=2
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="9132" --><tr>
<%
Response.buffer=True
If Session("mm_UserName") = "" Then Response.redirect "login.asp"
%>
<%
Total1 = 0
productprice = (FP_FieldHTML(fp_rs,"productprice"))
Quantity = (FP_FieldHTML(fp_rs,"quantity"))
ExtPrice = (FP_FieldHTML(fp_rs,"productprice") * (FP_FieldHTML(fp_rs,"quantity")))
total = Total + (Quantity * ProductPrice)
%>
<td>
<input type="text" name="quantity" size="20" value="<%=quantity%>"></td>
<td>
<input type="text" name="Product" size="20" value="<%=FP_FieldVal(fp_rs,"ProductName")%>"></td>
<td>
<input type="text" name="ProductPrice" size="20" value="<%=productprice%>"></td>
<td> <%=extprice%></td>
</tr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="../_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" align="left" width="100%"><font color="#000000">This is the end of a Database Results region.</font></td></tr>" startspan --><!--#include file="../_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="56926" --></tbody>
</table>
</center>
</div>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="95%" id="AutoNumber7" height="16">
<tr>
<td width="25%" height="16"></td>
<td width="25%" height="16"></td>
<td width="25%" height="16"><font face="Verdana" size="2"><b>Total</b></font></td>
<td width="25%" height="16"><%=total%></td>
</tr>
</table>
</center>
</div>
<p><font face="Verdana" size="2"><b>Deliver To:</b></font></p>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="95%" id="AutoNumber1">
<tr>
<td width="100%">
<!--webbot bot="DatabaseRegionStart" s-columnnames="U_ID,U_PASSWORD,U_FIRST,U_LAST,U_ADDRESS,U_CITY,U_STATE,U_ZIP,U_EMAIL,U_PHONE,U_FAX,Date,ACCESS" s-columntypes="202,202,202,202,202,202,202,202,202,202,202,135,202" s-dataconnection="classifieds" b-tableformat="FALSE" b-menuformat="FALSE" s-menuchoice="U_ID" s-menuvalue="U_ID" b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE" s-recordsource="USERS" s-displaycolumns="U_ID,U_PASSWORD,U_FIRST,U_LAST,U_ADDRESS,U_CITY,U_STATE,U_ZIP,U_EMAIL,U_PHONE,U_FAX,Date,ACCESS" s-criteria="[U_ID] EQ {UID} +" s-order s-sql="SELECT * FROM USERS WHERE (U_ID = '::UID::')" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields="UID=" s-norecordsfound="No records returned." i-maxrecords="256" i-groupsize="0" botid="1" u-dblib="../_fpclass/fpdblib.inc" u-dbrgn1="../_fpclass/fpdbrgn1.inc" u-dbrgn2="../_fpclass/fpdbrgn2.inc" tag="BODY" preview="<table border=0 width="100%"><tr><td bgcolor="#FFFF00" align="left"><font color="#000000">This is the start of a Database Results region.</font></td></tr></table>" b-wastableformat="FALSE" startspan --><!--#include file="../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM USERS WHERE (U_ID = '::UID::')"
fp_sDefault="UID="
fp_sNoRecords="No records returned."
fp_sDataConn="classifieds"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice="U_ID"
fp_sMenuValue="U_ID"
fp_sColTypes="&U_ID=202&U_PASSWORD=202&U_FIRST=202&U_LAST=202&U_ADDRESS=202&U_CITY=202&U_STATE=202&U_ZIP=202&U_EMAIL=202&U_PHONE=202&U_FAX=202&Date=135&ACCESS=202&"
fp_iDisplayCols=13
fp_fCustomQuery=False
BOTID=1
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="35199" --><p>
<font face="Verdana" size="2">
<input type="text" name="First" size="35" value="<%=FP_FieldVal(fp_rs,"U_FIRST")%>">
<input type="text" name="Last" size="35" value="<%=FP_FieldVal(fp_rs,"U_Last")%>"></font></p>
<p>
<font face="Verdana" size="2">
<input type="text" name="address" size="35" value="<%=FP_FieldVal(fp_rs,"U_address")%>">,
<input type="text" name="suburb" size="35" value="<%=FP_FieldVal(fp_rs,"U_city")%>"><b><br>
</b>
<br>
<input type="text" name="postalcode" size="35" value="<%=FP_FieldVal(fp_rs,"U_zip")%>"></font></p>
<p> </p>
<p><font face="Verdana" size="2">
<!--webbot bot="DatabaseResultColumn" s-columnnames="U_ID,U_PASSWORD,U_FIRST,U_LAST,U_ADDRESS,U_CITY,U_STATE,U_ZIP,U_EMAIL,U_PHONE,U_FAX,Date,ACCESS" s-column="U_EMAIL" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-menuformat preview="<font size="-1"><<</font>U_EMAIL<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"U_EMAIL")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="11534" --></font></p>
<p><font face="Verdana" size="2">
<!--webbot bot="DatabaseResultColumn" s-columnnames="U_ID,U_PASSWORD,U_FIRST,U_LAST,U_ADDRESS,U_CITY,U_STATE,U_ZIP,U_EMAIL,U_PHONE,U_FAX,Date,ACCESS" s-column="U_PHONE" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-menuformat preview="<font size="-1"><<</font>U_PHONE<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"U_PHONE")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="11519" --></font></p>
<p><font face="Verdana" size="2">
<!--webbot bot="DatabaseResultColumn" s-columnnames="U_ID,U_PASSWORD,U_FIRST,U_LAST,U_ADDRESS,U_CITY,U_STATE,U_ZIP,U_EMAIL,U_PHONE,U_FAX,Date,ACCESS" s-column="U_FAX" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-menuformat preview="<font size="-1"><<</font>U_FAX<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"U_FAX")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="7373" --></font></p>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE" b-menuformat="FALSE" u-dbrgn2="../_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside tag="BODY" preview="<table border=0 width="100%"><tr><td bgcolor="#FFFF00" align="left"><font color="#000000">This is the end of a Database Results region.</font></td></tr></table>" startspan --><!--#include file="../_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="56926" --><p>
<font face="Verdana" size="2"> </font></td>
</tr>
</table>
</center>
</div>
<p style="margin-top: 0; margin-bottom: 0">
<font face="Verdana" size="2"><b>Delivery Options:</b></font></p>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="95%" id="AutoNumber5">
<tr>
<td width="100%">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber6">
<tr>
<td width="50%"><font face="Verdana">
<input type="radio" value="Collect" name="DeliveryOptions"><font size="2">I
Will Collect</font></font></td>
<td width="50%"><font face="Verdana">
<input type="radio" value="Post" name="DeliveryOptions"><font size="2">Please
send it to me</font></font></td>
</tr>
<tr>
<td width="50%"> </td>
<td width="50%"> </td>
</tr>
<tr>
<td width="50%"><font face="Verdana" size="2">Collections can
be made from:</font><p><font face="Verdana" size="2">Edenvale
JHB</font></p>
<p><font face="Verdana" size="2">Garsfontein PTA</font></td>
<td width="50%"><font face="Verdana" size="2">We will contact
you with a quote regarding delivery costs</font></td>
</tr>
</table>
<p> </td>
</tr>
</table>
</center>
</div>
<p> </p>
<p><font face="Verdana">
<input type="submit" value="Process Order" name="B1"></font></p>
<input type="hidden" name="UID" value="<%=session("mm_UserName")%>">
</form>
<p><font face="Verdana" size="2"><br>
</font></td>
</tr>
</table>
</center>
</div>
</body>
</html> please help
|
|
|
|