I want my php code to check whether a certain DB exists, by means of running some sql query andd parsing the result.
What would be a nice way to do it?
Thanks
Gidi
I want my php code to check whether a certain DB exists, by means of running some sql query andd parsing the result.
What would be a nice way to do it?
Thanks
Gidi
Run SHOW DATABASES and loop over the results with PHP to check for the existence.
If it were only one database, you could also add a condition to the SQL query directly and simply check if it returned a result or not with PHP. This would avoid the loop.