Re: good math for writing a resultSet to an HTML table?

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

 



Caleb Ruth wrote:

I am selecting a single column from a db table and I want to split it into a
3 column HTML table. I am sure this has been done before. Any ideas?

$x=1; echo "<table><tr>"; while($r = fetchRow($result)) { echo "<td>{$r['data']}</td>"; if($x++%3==0) echo "</tr><tr>"; } echo "</tr></table>";

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

--
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