On Thursday, 4. April 2002 08:12, Doug Bishop wrote:
> <?
> mysql_connect("localhost", "user", "password");
> $query = "SHOW TABLES;";
> $result = mysql_db_query("databasename", $query);
> $i = 0;
> while ($row = mysql_fetch_array($result))
> {
> $tableNames[$i] = $row[0];
> $i++;
> }
> for ($i = 0; $i <= count($tableNames); $i++)
> {
> $query = "SELECT COUNT(*) FROM " . $tableNames[$i] . ";";
> $result = mysql_db_query("databasename", $query);
> $row = mysql_fetch_array($result);
> echo "Table " . $tableNames[$i] . " contains " . $row[0] . " rows.\n<br>";
> }
> ?>
I think Andy asked for a general solution, not for a solution in PHP. Not all
people are working with PHP. There are a lot of other languages like C, Perl,
Python, ... which all supports MySQL.
Finally a little note about your PHP Code: Did you ever heard about
mysql_free_result ?!
Regards
Georg
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php