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? 

You could use "SHOW DATABASES LIKE 'myDb'".

  http://dev.mysql.com/doc/mysql/en/Show_database_info.html

Jim Winstead
MySQL AB

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

Reply via email to