PHP help [message #53869] |
Tue, 04 November 2003 15:43 |
|
Crimson
Messages: 7430 Registered: February 2003 Location: Phoenix, AZ
Karma:
|
General (5 Stars) ADMINISTRATOR |
|
|
<?PHP
$products = "SELECT * FROM Products ORDER BY id DESC";
$result = mysql_query($products) or die ("Query Failed");
$items_to_list = mysql_num_rows($result);
$i = 0;
echo "<table width=\"100%\" border=\"1\">";
echo "<TR>";
while($i < $items_to_list) {
$left = mysql_fetch_object($result);
$right = mysql_fetch_object($result);
echo "<td colspan=\"2\"><font face=\"arial\" size=\"2\">$left->title</font></td>";
if ($right) {
echo "<td colspan=\"2\"><font face=\"arial\" size=\"2\">$right->title</font></td>";
}
echo "</TR><TR>";
echo "<td><font face=\"arial\" size=\"2\">$left->description</font></td>";
echo "<td><IMG SRC=\"upload/$left->image\" width=\"50\" height=\"50\"></td>";
if ($right) {
echo "<td><font face=\"arial\" size=\"2\">$right->description</font></td>";
echo "<td><IMG SRC=\"upload/$right->image\" width=\"50\" height=\"50\"></td>";
}
echo "</TR><TR>";
$i = $i + 2;
}
echo "</TR>";
echo "</table>";
?>
Once again, I didn't test this, but I didn't notice the colspan 2 cell.
I'm the bawss.
|
|
|