Hi, I was wondering how to check if a database is empty. Thanks.
bump
There doesnt seem to be a mysql_num_tables() function, maybe you can make do with mysql_list_tables?
Conversely, you could use SHOW TABLES; via shell.
Sorry, I meant if there was a way I could check to see if a table is empty?
That's easier. You could try
<?php $query = mysql_query("SELECT * FROM tablename"); if (mysql_num_rows($query) == 0) echo 'Table is empty'; else echo 'Table contains rows'; ?>