直接上码
<?php
//////////
// $find_table 要查找的表名
// $database 已经连接的数据库句柄
function check_table_is_exist($find_table,$database)
{
$sqlExce = "show tables "; // to show databases
$row = mysql_query($sqlExce,$database);
while ($result = mysql_fetch_array($row,MYSQL_NUM ))
{
for( $i = 0 ; $i < count($result); $i++){
if( $find_table == $result[$i]) {
// echo "found " . $find_table . ‘<br />‘;
return true;
}
}
}
return false;
}
?>
原文:http://blog.csdn.net/qyvlik/article/details/45096289