Re: Column help needed (Table)
| From: | Pablo M. Rivas | Date: | Tue, 13 Jul 2004 17:58:08 +0000 |
| Subject: | Re: Column help needed (Table) | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-35227@lists.php.net to get a copy of this message | ||
Hello Chris,
easy as this?
<?php
$odd=1;
while ($row=mysql_fetch_row($Res)) {
if ($odd) {
echo "\n<tr>";
$odd=0;
} else $odd=1;
echo "<td>" . $row[0] . "</td>";
}
?>
CP> Hi there everyone,
CP> I need my MySQL query to be displayed in a table, which is no problem, but I
CP> only want 2 results per row to be displayed - so if I had 10 returned
CP> results from my Database, it would display 2 per column on 5 rows. How can
CP> I do this dynamically?
CP> Any help would be really appreciated.
CP> Thanks
CP> Chris
--
Best regards,
Pablo