You are here: Re: counting tables « PHP SQL « IT news, forums, messages
Re: counting tables

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация