RE: [PHP-DB] Result set in different columns
| From: | Bastien Koert | Date: | Mon, 10 Apr 2006 14:24:37 +0000 |
| Subject: | RE: [PHP-DB] Result set in different columns | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-41687@lists.php.net to get a copy of this message | ||
$cols = 2;
echo "<table><tr>";
while ($rows = mysql_fetch_array($result))
{
if (($cols % 2) == 0 ){ echo "</tr><tr>"; }
echo "<td>".$rows['something']."</td>";
$c++;
}
echo "</tr></table>";
bastien
From: Mark Bomgardner <mbomgardner@kletc.org>
Reply-To: mbomgardner@kletc.org
To: Php-Db <php-db@lists.php.net>
Subject: [PHP-DB] Result set in different columns
Date: Mon, 10 Apr 2006 09:00:06 -0500
I am trying to work through some display logic where I want to display a results set from a database query into to columns in a table, but I can't see to get it correct.
Example; I want to loop through the months of the year and display them like this;
January February
March April
May June
July August
September October
November December
Any ideas?
Mark Bomgardner
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php