SV: [PHP-DB] Drawing table by while
| From: | Henrik Hornemann | Date: | Wed, 26 May 2004 12:34:03 +0000 |
| Subject: | SV: [PHP-DB] Drawing table by while | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-34561@lists.php.net to get a copy of this message | ||
Something like this:
echo '<table>';
$count=1;
while ($myrow = mysql_fetch_array($sql))
{
If ($count==5) {
echo "</tr>";
$count=1;
}
If ($count==1) echo "<tr>";
$count++;
echo $myrow[0];
}
echo '</table>';
Hth Henrik Hornemann
-----Oprindelig meddelelse-----
Fra: nabil [mailto:nabil.attar@aws-syria.com]
Sendt: 26. maj 2004 14:28
Til: php-db@lists.php.net
Emne: [PHP-DB] Drawing table by while
Hiya,
How can i draw a new <tr> AFTER FIVE <td> in the following loop
(i want to echo the records in 5 columns width tables whatever the
number of records will be fetched)
..
echo '<table>';
while ($myrow = mysql_fetch_array($sql))
{
echo $myrow[0];
}
echo '</table>';
------------------------------
| x | y | z | o |
------------------------------
| f | q | h | hj |
------------------------------
.
.
.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php