note 38501 added to function.dbase-numfields
| From: | imax at intercomax dot com dot br | Date: | Wed, 24 Dec 2003 13:48:46 +0000 |
| Subject: | note 38501 added to function.dbase-numfields | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-62418@lists.php.net to get a copy of this message | ||
if you wanna show all the registers of a table just do it:
$tot = dbase_numrecords($dbf);
if($tot > 1)
{
echo "<center>Total: ".($tot-1)."<center><br>";
echo "<table border=1 cellpadding=8 cellspacing=0 align=center>";
for($x=1; $x < $tot; $x++)
{
$rec = dbase_get_record($dbf, $x);
$nf = dbase_numfields($dbf);
echo "<tr>";
for ($i=0; $i < $nf; $i++)
{
echo "<td>$rec[$i]</td>";
}
echo "</tr>";
}
echo "</table>";
}
why tot > 1 ? its seens that the first reg. its the header
----
Manual Page -- http://www.php.net/manual/en/function.dbase-numfields.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+38501
Delete -- http://master.php.net/manage/user-notes.php?action=delete+38501&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+38501&report=yes
Search -- http://master.php.net/manage/user-notes.php