Page 1 of 1

php can not access to the database password

Posted: Thu Apr 08, 2004 3:42 am
by yk
please... can some one tell me what the problem with the following command.


@ $db = mysql_pconnect('localhost', 'root', 'somepassword');

if (!$db)
{
echo 'Error: Could not connect to database. Please try again later.';
exit;
}

Posted: Thu Apr 08, 2004 3:57 am
by malcolmboston
why are you doing that?

use

Code: Select all

$server = "localhost";
$user = "username";
$pass = "password";
$database = "database";

mysql_pconnect('$server', '$user', '$pass') or die(mysql_error());
mysql_select_db('$database') or die(mysql_error());