Here is a MySQL stored function I created that allows you to check if a database table exists in the database you are using. This MySQL stored function dynamically check is the table name exists in the database the stored function is being used in, here is an example: SELECT sf_is_table('mytable') AS is_table;Which gives you results like: +-------------+
| is_table |
+-------------+
| 1 |
+-------------+