Jump to content

Recommended Posts

I am generating a few different reports through mysql querys and displaying tables.  I have a mail script that stores html code into a variable called $message.  How can I store all of my queried data into the variable $message?

 

Example of one of the three tables I am displaying and I am wanting to store this whole table into the variable $message.

echo"<h3>Margin Less than 15% for $datequery</h3>";
echo"<table border=1 cellpadding=3><tr><td><center><b>Invoice Number</b></center></td><td><center><b>Invoice Date</b></center></td><td><center><b>Customer Number</b></center></td><td><center><b>Company</b></center></td><td><center><b>Margin</b></center></td></tr>";
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$invoice=$row['INVNO'];
$invoicedate=$row['INVDTE'];
$customernumber=$row['CUSTNO'];
$company=$row['COMPANY'];
$invoicetotal=$row['ITOTAL'];
$invoicecost=$row['ICOST'];




@$ABOVE30=  @($invoicecost * 100) / $invoicetotal;
   @$FINAL30=100 - $ABOVE30;
  $FINAL30=number_format($FINAL30, 2, '.', '');




IF($FINAL30<="15")
{
echo "<tr><td><center>$invoice</center></td><td><center>$invoicedate</center></td><td><center>$customernumber</center></td><td><center>$company</center></td><td><center>$FINAL30%</center></td></tr>";
}

   
} 
echo"</table><hr />";

Link to comment
https://forums.phpfreaks.com/topic/230640-storing-queries-into-one-variable/
Share on other sites

I'm confused, I don't see any variable in your script named message.  If I had to guess, you're on the right track here:

I think I may have it.  I am changing all of my echo's to $message =.

by concatenating the data you can store it all in a single variable.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.