具体如下:
pdo:
getMessage()); } $table = 'cy_news'; //判断表是否存在 $result = $pdo->query("SHOW TABLES LIKE '". $table."'"); $row = $result->fetchAll(); if('1' == count($row)){ echo "Table exists"; } else { echo "Table does not exist"; } ?>
mysql:
上一篇:利用PHP怎么对mysql主从数据库状态进行检测
下一篇:Laravel中怎么接收前端ajax传来的数据