Click to See Complete Forum and Search --> : cannot access mysql db in wamp5


Eugene
07-25-2007, 02:17 AM
Hi

I am currently doing a web project using wamp5. Right now this is how
i am connecting to the database:


$con = mysql_connect("localhost", "root", "");
if (!con) {
die('Could not Connect' . mysql_error());
}
if (!mysql_select_db("Leave", $con)){
die (mysql_error());


}


else {
.......


}


When the code above is activated, this is the result:
"Unknown database 'leave' "

Could there be anything in mysql that i might have done wrong that
triggers the error? or maybe there is a problem in my $con object in
the 1st place?


Help is much appreciated


thanks :)

bubbisthedog
07-25-2007, 03:15 PM
I think you'll be better served in the PHP forum for this particular issue. Two questions, though:

a) Do you realize that you're missing the dollar sign ($) before 'con' in your first condition?

b) The database name parameter may be case sensitive; have you ensured that the case is correct?

Eugene
07-26-2007, 01:50 AM
Thanks i have already solved the problem. Used MySQL Administrator and Query Browser instead and integrated with WAMP as the SQLiteManager is not a adminstrator linked to mysql, it is simply a database itself.