|
Posted by Tyno Gendo on 05/15/07 08:42
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?
<?php
mysql_connect("localhost", "<user>", "<pass>");
mysql_select_db("<database>");
$sql = "SHOW TABLES;";
$ds = mysql_query( $sql );
echo mysql_num_rows( $ds );
mysql_free_result( $ds );
?>
Navigation:
[Reply to this message]
|