
RAZA - 2009-08-19 06:20:43
Hey guys!
Thanks a lot for your feedback. Unfortunately the file Site.php was not approved. I have uploaded its other copy Site2.php in the includes/classes/ folder. If you still cant find the file, worry not. Here is the code for the file Site.php.
<?php
class Site
{
public function ListProducts()
{
$sql="select productName,productCode,productPrice from products;";
$query=mysql_query($sql);
echo '<table>';
echo '<thead>';
echo '<tr>';
echo '<th>Product Name</th>';
echo '<th>Product Code</th>';
echo '<th>Product Price</th>';
echo '<th>Purchase</th>';
echo '</tr>';
echo '</thead>';
echo '<tbody>';
while($row=mysql_fetch_row($query))
{
echo '<tr>';
echo '<td>'.$row[0].'</td>';
echo '<td>'.$row[1].'</td>';
echo '<td>'.$row[2].'</td>';
echo '<td><a href="Cart.php?add='.$row[1].'">Add to Cart</a></td>';
echo '</tr>';
}
echo '</tbody>';
echo '</table>';
}
}
?>