As simple in theory as it sounds I\'ve done a fair amount of research and am having trouble figuring this out.
How can I check if a MySQL table exists and if it does
SHOW TABLES LIKE 'TableName'
If you have ANY results, the table exists.
To use this approach in PDO:
$pdo = new \PDO(/*...*/);
$result = $pdo->query("SHOW TABLES LIKE 'tableName'");
$tableExists = $result !== false && $result->rowCount() > 0;
To use this approach with DEPRECATED mysql_query
$result = mysql_query("SHOW TABLES LIKE 'tableName'");
$tableExists = mysql_num_rows($result) > 0;