For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > April 2006 > RE: [PHP-DB] Result set in different columns









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RE: [PHP-DB] Result set in different columns
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
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com