Another way to check if a table exists:
if(mysql_num_rows(mysql_query("SHOW TABLES LIKE '".$table."'"))==1) echo "Table exists";
else echo "Table does not exist";
![]() | mysql_tablename说明string mysql_tablename ( resource result, int i )mysql_tablename() 接受 mysql_list_tables() 返回的结果指针以及一个整数索引作为参数并返回表名。可以用 mysql_num_rows() 函数来判断结果指针中的表的数目。用 mysql_tablename() 函数来遍历此结果指针,或者任何处理结果表的函数,例如 mysql_fetch_array()。 ![]()
Haseldow
23-Apr-2004 08:00
Another way to check if a table exists:
pl at thinkmetrics dot com
18-Dec-2003 12:00
A simple function to check for the existance of a table: | ![]() | |