>On Thu, May 27, 2004 at 03:59:46PM -0400, Bono, Saroj AA R62 wrote:
>> I am going to use mysql_query() and want to find out if a certain
>> database  exists. If  mysql_real_connect() fails there are many errors
>> that could account for this. The database may exist , and I cant take
>> the error returned from the failed  query to mean the db isnt there and
>> should be created. So what sort of query can I use to see whether the db
>> exists? I thought of "USE myDb" but once again a failed mysql_query cant
>> rule out other factors that can cause the failure. Any suggestions? 

Are you using PHP?  You can use the mysql_list_dbs() function:

http://www.php.net/manual/en/function.mysql-list-dbs.php

 - seb

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to