Re: good math for writing a resultSet to an HTML table?
| From: | John W. Holmes | Date: | Thu, 04 Sep 2003 23:40:39 +0000 |
| Subject: | Re: good math for writing a resultSet to an HTML table? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-30339@lists.php.net to get a copy of this message | ||
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