Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

Email - Mysql data in simple text email

Hi all. I am trying to input the data from a (paypal) mysql database into a simple text email to the customer to confirm the items and quantities they have purchased. This is easy to produce in an HTML table ... but I am finding it impossible to extract the data in a form that is suitable for a simple text email. The code at present looks like this:

CodeDownload  
$myDataID = mysql_query("SELECT paypal_cart_info.itemname, paypal_cart_info.quantity FROM paypal_cart_info WHERE  paypal_cart_info.txnid = '$txnid'", $connectID) or die ("Can't read the this record.");

print "<table border=\"1\">\n";
print '<tr style="font-weight:bold;">
<td>Itemname</td>
<td>Quantity</td>
</tr>';
while ($row = mysql_fetch_row($myDataID)) {
print '<tr>';
foreach ($row as $field) {
    print '<td>'.$field.'</td>';
      }
   print "</tr>\n";
}
print '</table>';



Your thoughts on how to overcome this problem would be greatfully received - as it's driving me bonkers! My thoughts up to now have centred around trying to turn each piece of table date (from the array) into individual variables .. but this path seems hopeless unless someone can come up with a solution. Many thanks in anticipation. Cheers.

Mod: inserted code tags
Thread Information
Author
Replies
1 post
Views
2073 times
Last Post
Last updated on 11 years ago
You can view all discussion threads in this forum.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You cannot download attachments in this forum.