[thelist] Converting a loop into Sendmail

Flavia Silveira-Tarzwell (FayeC) fayec at canada.com
Thu Aug 2 15:42:57 CDT 2001


Hi Matthias,

The funny part is that the email sent has the user's info but not the
products ordered...
I know I have to include a loop in the sendmail to request all the
products from cart but I don't know how to do it within the
sendmail.....

Thanks anyways,

FayeC

Matthias Ritzkowski wrote:
> 
> 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 !
> 
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt !

-- 
Flavia Tarzwell (FayeC)
Web Designer/Developer
http://www.3xtend.com
Extend your Web presence.




More information about the thelist mailing list