Re: "Couldn't select database." --> database DOES exist!!!

From: Date: Tue, 09 Jan 2001 12:22:11 +0000
Subject: Re: "Couldn't select database." --> database DOES exist!!!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-33440@lists.php.net to get a copy of this message
Try adding mysql_error() to the die finction. It normally tells you exactly what mysql is trying to do and why it went wrong. e.g: $db = mysql_select_db("searchDB", $connection) or die("Couldn't select database. MySQL said: " .mysql_error()); Thanks William. On 2001.01.09 12:14:03 +0000 Yoeri De Bruyn wrote: > Hi, > > When I use this php calls on Win2000 configuration everything works > fine, but migrating the site and DB to Linux, apparently the database > can not be found! > I use the following way to connect to my database: > > //create connection > $connection = mysql_connect("localhost","","") > or die("Couldn't connect to server."); > > //select database > $db = mysql_select_db("searchDB", $connection) > or die("Couldn't select database."); > > and I get : --> "Couldn't select database." > PS: I can "browse" the DB on linux via command line without any probs, > so?! > If you feel like "damn! I've seen that once in my whole life!" (or even > if you didn't) please tell me what you did to get rit of that feeling... > ;-) !!! > Thanks a llllllllot! > Saludos, > Yoeri. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#33440) next »