heres my code:
Code: Select all
<?php
include "storescripts/connect_to_mysql.php";
?>
<?php
// Script Error Reporting
error_reporting(E_ALL);
ini_set('display_errors', '1');
?>
<?php
$food_list = "";
$sql = mysql_query("SELECT * FROM food ORDER BY subcategory DESC");
$productCount = mysql_num_rows($sql); // count the output amount
if ($productCount > 0) {
while($row = mysql_fetch_array($sql)){
$id = $row["id"];
$product_code = $row["product_code"];
$description = $row["description"];
$units_per_product = $row["units_per_product"];
$product_price = $row["product_price"];
$unit_price = $row["unit_price"];
$points = $row["points"];
$subcategory = $row["subcategory"];
$food_list .= '
<body topmargin="0" leftmargin="0">
<div align="center">
<table cellpadding="0" cellspacing="0" border="0" bordercolor="#C0C0C0" width="768" height="45">
<!-- MSTableType="layout" -->
<tr>
<td valign="middle" width="89" style="border-left-style: solid; border-left-width: 1px; border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-right-style:none; border-right-width:medium">
<font face="Verdana" size="1"> ' .$product_code. '</font></td>
<td valign="middle" width="244" style="border-left-style: none; border-left-width: medium; border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-right-style:none; border-right-width:medium">
<font face="Verdana" size="2"> ' .$description. '</font></td>
<td valign="middle" width="118" style="border-left-style: none; border-left-width: medium; border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-right-style:none; border-right-width:medium">
<p align="center"><font face="Verdana" style="font-size: 8.5pt">' .$units_per_product. '</font></td>
<td valign="middle" width="79" style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:solid; border-top-width:1px; border-bottom-style:solid; border-bottom-width:1px">
<p align="left"><font face="Verdana" style="font-size: 8.5pt"> $' .$unit_price. ' </font></td>
<td valign="middle" width="93" style="border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium">
<p align="left"><font face="Verdana" style="font-size: 8.5pt"> $' .$product_price. '</font></td>
<td width="84" style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:solid; border-top-width:1px; border-bottom-style:solid; border-bottom-width:1px" valign="middle">
<p align="right"> <font face="Verdana" size="1">0</font>
<font face="Verdana" size="2">' .$qty. '</font><font face="Verdana" size="1"> </font></td>
<td height="45" width="59" style="border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1px; border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px">
</p> </td>
</tr>
</table>
</div>
<div align="center">
<table cellpadding="0" cellspacing="0" width="779" height="3">
<!-- MSTableType="layout" -->
<tr>
<td width="779" height="3"></td>
</tr>
</table>
</div>';
}
} else {
$food_list = "Your Food Store Is Empty";
}
mysql_close();
?>
http://www.malloukcompany.com.au/ss.png