Hi there. I have a crontab entry that runs the following code. The problem is the email only has a bunch of 1's. Probably it has to do with my $mailbody. Any suggestions as how I can print out this table correctly in an email.
$mailbody=print "<html><body>";
$query= "SELECT * FROM shiplist WHERE quantity > '0' ORDER BY store";
$result= mysql_query($query) or print(mysql_error());
$mailbody .= print "<p align=center><font size=4><b>Shiplist Report </b></font></p>";
$mailbody .= print "<br>";
$mailbody .= print "<table border=0 width=76% cellpadding=0 cellspacing=0 align=center bgcolor=#3366CC ";
$mailbody .= print "<tr>
<td width=11%> <p align=center><b><font color=#FFFFFF><a href=shiplistsort.php?order=date>Date</font></td>
<td width=8%><p align=center><b><font color=#FFFFFF><a href=shiplistsort.php?order=store>Store</font></td>
<td width=35%><p align=center><b><font color=#FFFFFF><a href=shiplistsort.php?order=equipment>Equipment</font></td>
<td width=6%><p align=center><b><font color=#FFFFFF><a href=shiplistsort.php?order=quantity>Qty</font></td>
<td width=17%><p align=center><b><font color=#FFFFFF><a href=shiplistsort.php?order=enteredby>Entered By</font></td>
<td width=8%><p align=center><b><font color=#FFFFFF></font></td>
<td width=6%><p align=center><b><font color=#FFFFFF></font></td>
</tr>
</table>";
while($line= mysql_fetch_array($result, MYSQL_ASSOC))
{
$get="select * from main where equipmentid='$line[equipmentid]'";
$getresult=mysql_query($get, $link) or print(mysql_error());
$getline=mysql_fetch_array($getresult, MYSQL_ASSOC) or print(mysql_error());
$mailbody .= print "<table border=0 width=76% cellpadding=0 cellspacing=0 onMouseover=\"changeto(event,'#99CCFF')\" onMouseout=\"changeback(event, '#EFEFEF')\" align=center bgcolor=#EFEFEF>";
$mailbody .= print "<tr>
<td width=11%>$line[date]</td>
<td width=35%>$getline[equipment]</td>
<td width=6%>$line[quantity]</td>
<td width=17%>$line[enteredby]</td>
</tr>
</table>";}
$mailbody .= print "</body></html>";
mail problem
Moderator: General Moderators
Remove 'print' e.g. ...
Should just be...
Code: Select all
$mailbody=print "<html><body>";Code: Select all
$mailbody= "<html><body>";