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, SQLite, etc.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Do:
and then catch the error. If you don’t get any error, but resultset with one column containing “1”, then the table exists.