[thelist] Converting a loop into Sendmail

Matthias Ritzkowski Matt at grndwtr.com
Thu Aug 2 12:24:50 CDT 2001


Faye -
I would replace your sql string

sqlString = "SELECT * FROM users WHERE user_id=" & userID

with 

sqlString = "SELECT user_firstname, user_lastname FROM users WHERE user_id="
& userID

I generally run into problems using * if you need to access the results per
column afterwards ...

Matthias

-----Original Message-----
From: FayeC [mailto:fayec at canada.com]
Sent: Thursday, August 02, 2001 12:47
To: Evolt
Subject: [thelist] Converting a loop into Sendmail


Hi,

I have the following code on a checkout page and I need to convert it
and be able to add that info to a sendmail.
The sendmail I am using doesn't show the product and gives me an error
when I add the variable "quantity" to it...
I have tried to find the answer by myself but even my *very thick* Wrox
books haven't helped me...
I am now looking for help on this list.
If any of you could help me write a sendmail that would use the
variables from this table (Product, price, quantity, total, user name,
surname, address)
I would be very grateful.
Let me know if you need more information than what I have pasted here.

Thank you in advance,

FayeC

<table border="1" cellpadding="4" cellspacing="0" width="80%">
			<tr>
				<td>Product</td>
				<td>Price</td>
				<td>Quantity</td>
				<td>Total for this product</td>
			</tr>
			<%
			WHILE NOT cartRS.EOF
			orderSubTotal = orderSubTotal +
(cartRS("product_price") *
cartRS("cart_quantity"))
			%>
			<tr>
				<td><b><%= cartRS("product_name")
%></b></td>
				<td align="right"><b><%=FormatCurrency(
cartRS ("product_price"))
%></b></td>
				<td align="center"><b><%= cartRS
("cart_quantity") %></b></td>
				<td align="right"><% productTotal =
cartRS("product_price") *
cartRS("cart_quantity") %><b><%=FormatCurrency(productTotal) %></b></td>
			</tr>
			<%
			cartRS.MoveNext
			WEND
			%>
			
			
	<%
	Dim userRS
	
	sqlString = "SELECT * FROM users WHERE user_id=" & userID
	Set userRS = Con.Execute(sqlString)
	WHILE NOT userRS.EOF
	%>
	
	<tr>
		<td colspan="3" align="right"><font color="red"><b>Shipping
details:</b></font></td>
		<td align="right">
		<%=userRS("user_firstname") & " " & userRS("user_lastname")
%>
		<br>
		<%=userRS("user_street") %>
		<br>
		<%=userRS("user_city") & ", " & userRS("user_province") & ",
" &
userRS("user_province") & ", " & userRS("user_postalcode") %>
		</td>
	</tr>
	
</table>
</center>
<%
userRS.MoveNext
WEND
%>

---------------------------------------
For unsubscribe and other options, including
the Tip Harvester and archive of TheList go to:
http://lists.evolt.org Workers of the Web, evolt ! 




More information about the thelist mailing list