Re: cannot connect to MySQL server and not sure why
| From: | Richard Davey | Date: | Thu, 14 Jul 2005 15:36:06 +0000 |
| Subject: | Re: cannot connect to MySQL server and not sure why | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-218694@lists.php.net to get a copy of this message | ||
Hello Bruce,
Thursday, July 14, 2005, 4:27:12 PM, you wrote:
BG> ?php
BG> $database="bruceg_search";
BG> $mysql_user = "bruceg_webmaster";
BG> $mysql_password = " password";
BG> $mysql_host = "server-10.existhost.com";
BG> mysql_pconnect ($mysql_host, $mysql_user, $mysql_password);
BG> if (!$success)
BG> die ("<b>Cannot connect to database, check if username, password
BG> and
BG> host are correct.</b>");
BG> $success = mysql_select_db ($database);
BG> if (!$success) {
BG> print "<b>Cannot choose database, check if database name is
BG> correct.";
BG> die();
BG> }
?>>
BG> I double checked the database and I have created a database called
BG> bruceg_search and added a user called bruceg_webmaster with all of
BG> the editing privileges. Of course 'password' is changes with the
BG> password used to connect in the actual script. and I double
BG> checked that to be correct as well. Any suggestions?
Sure.. where is $success set?
I don't see it being set anywhere :)
Best regards,
Richard Davey
--
http://www.launchcode.co.uk - PHP Development Services
"I do not fear computers. I fear the lack of them." - Isaac Asimov