Re: Can't connect to MySQL

From: Date: Mon, 21 Aug 2000 22:42:10 +0000
Subject: Re: Can't connect to MySQL
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-12829@lists.php.net to get a copy of this message
> Hi, > > I'm not able to connect to MySQL from the following script: > <? > # connect to the db and see if the username and pwrd are valid > $db = > mysql_connect("www.instantpublicity4u.com","drue","password") or > die("It didn't work."); > mysql_select_db(ipdb,$db); > ?> > Is this the script? If so, please help me there. If not, what other causes are there for this problem? Does it print the "It didn't work" error? If so, lack of permission to connect from outside the localhost, or with the username/password combination you're supplying, is the first thing that springs to my mind. If it doesn't print that error, it most likely means you've connected, and it's the call to mysql_select_db() that is the problem. You might want to enclose the name of the database in quotes, and check that user 'drue' has adequate permission to use the 'ipdb' database. Try putting a little more debug in there so you can get a better idea of where the error occured. At least add 'or die("couldn't select ipdb database");' to the end of the mysql_select_db(...) line. jason

« previous php.general (#12829) next »