counting tables
am 14.05.2007 23:46:40 von laredotornadoHi,
I'm using PHP 4.4.4 with MySQL 5.0. Given my db connection info, how
would I figure out how many tables were in the selected db?
Thanks, - Dave
Hi,
I'm using PHP 4.4.4 with MySQL 5.0. Given my db connection info, how
would I figure out how many tables were in the selected db?
Thanks, - Dave
laredotornado@zipmail.com wrote:
> Hi,
>
> I'm using PHP 4.4.4 with MySQL 5.0. Given my db connection info, how
> would I figure out how many tables were in the selected db?
http:/www.php.net/manual/en/function.mysql-list-tables.php
--
//Aho
laredotornado@zipmail.com wrote:
> Hi,
>
> I'm using PHP 4.4.4 with MySQL 5.0. Given my db connection info, how
> would I figure out how many tables were in the selected db?
>
> Thanks, - Dave
>
One way, maybe others that are better?
mysql_connect("localhost", "
mysql_select_db("
$sql = "SHOW TABLES;";
$ds = mysql_query( $sql );
echo mysql_num_rows( $ds );
mysql_free_result( $ds );
?>
news:1179179200.148304.182970@p77g2000hsh.googlegroups.com.. .
> Hi,
>
> I'm using PHP 4.4.4 with MySQL 5.0. Given my db connection info, how
> would I figure out how many tables were in the selected db?
>
> Thanks, - Dave
>
With MySQL I think you can run a query like "show tables;" and should be
able to get a count from those results.
Tom
--
Newsguy.com - Express Accounts - 30 GB $9.95 / month