On Thu, 4 Apr 2002, Doug Bishop wrote:
> Try:
>
> <?
> 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>";
> }
> ?>
Yes but this is PHP code that can only be run through a suitable web
server, browser, etc - I want a command line solution like mysqlshow ...
or from within the mysql client itself.
Andy
> -----Original Message-----
> From: andy thomas [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 03, 2002 11:23 PM
> To: [EMAIL PROTECTED]
> Subject: Table statistics
>
>
> Is there a command I can give in the mysql client to find the number of
> rows in a table or, better still, the number of rows in all the tables in
> a database?
>
> Andy
>
>
> ---------------------------------------------------------------------
> 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
>
---------------------------------------------------------------------
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