Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » General Discussions » General Discussion » PHP help
PHP help [message #53869] Tue, 04 November 2003 15:43 Go to previous messageGo to previous message
Crimson is currently offline  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.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Crimson Server?????????
Next Topic: OT: 12 Years Today.
Goto Forum:
  


Current Time: Sun Dec 29 08:45:45 MST 2024

Total time taken to generate the page: 0.00722 seconds