Number of rows
| From: | shaun | Date: | Tue, 04 Mar 2003 20:14:53 +0000 |
| Subject: | Number of rows | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-138161@lists.php.net to get a copy of this message | ||
Hi,
I am using the folling code to list all of my tables in a database:
<?php
$result = mysql_list_tables($database);
if (!$result) {
print "DB Error, could not list tables\n";
print 'MySQL Error: ' . mysql_error();
exit;
}
print"<table width=\"500\" height=\"18\" border=\"0\"
cellpadding=\"4\" cellspacing=\"0\">
<tr>
<td width=\"25%\"><span
class=\"text\">Table</span></td>
<td colspan=\"2\" width=\"60%\"><span
class=\"text\">Action</span></td>
<td width=\"15%\"><span
class=\"text\">Records</span></td>
</tr>";
while ($row = mysql_fetch_row($result)) {
print " <tr>
<td><span class=\"text\">$row[0]</span></td>
<td><a href=\"insert_data.php\" class=\"link\">add
data</a></td>
<td><a href=\"edit_data.php\" class=\"link\">edit
data</a></td>
<td><span class=\"text\">num_rows</span></td>
</tr>";
}
echo"</table>";
mysql_free_result($result);
?>
however, i would like to show the user how many rows there are in each table
(where i have put numrows), how could i do this?
thanks for your help