| Bastien Koert 2006-04-10, 6:57 pm |
| $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
>
|