I want to check if a table with a specific name exists in a database I\'ve connected to using PHP and PDO.
It has to work on all database backends, like MySQL, SQLi
If you have other major actions to do within the same statement, you can use the e->errorInfo
try{ //Your major statements here } catch(PDOException $e){ if($e->errorInfo[1] == 1146){ //when table doesn't exist } }