RE: Result set in different columns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



$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@xxxxxxxxx>
Reply-To: mbomgardner@xxxxxxxxx
To: Php-Db <php-db@xxxxxxxxxxxxx>
Subject:  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


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux