Php4 & MySql 3.22.32
| From: | Witness | Date: | Mon, 19 Jun 2000 15:36:57 +0000 |
| Subject: | Php4 & MySql 3.22.32 | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-482@lists.php.net to get a copy of this message | ||
I'm running Php4 on Apache 1.3.9 with MySql 3.22.32 on Redhat Linux 6.2.
I'm trying to design a website to access a mysql database using php but I'm
getting the following errors:
Warning: MySQL Connection Failed: Access denied for user:
'validuser@my.system.domain' (Using password: YES) in
/home/httpd/php/functions.php on line 25
Warning: Supplied argument is not a valid MySQL-Link resource in
/home/httpd/php/functions.php on line 26
Cannot Connect to Database!
here's some sample code for how I am connecting:
...
$Connection;
$Connected = 0;
$Debug = 1;
...
function Connect_To_Database($User,$Password)
{
global $Connection;
if ($Connected == 1)
{
echo "<STRONG>Already Connected to database!</STRONG>";
echo "Please close the current connection";
exit;
}
$Connection = mysql_connect("127.0.0.1",$User,$Password);
if (!mysql_select_db("validDb",$Connection))
{
echo "<STRONG>Cannot Connect to Database!</STRONG>";
exit;
}
else
{
$Connected = 1;
if ($Debug)
{
echo "<STRONG>Connected!</STRONG>";
}
exit;
}
}
...
Connect_To_Database("validUser","validPassword");
...
Any ideas? I'm lost as to what to do and really need this working soon.
Thanks.
BRM