I have set the password for root and grant all privileges for root. Why does it say it is denied?
****mysql_query() [function.mysql-query]: Access denied for user 'SYSTEM'@'localhost' (using password: NO) in C:\wamp\www\photo_gallery\includes\database.php on line 56
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\wamp\www\photo_gallery\includes\database.php on line 56
The Query has problemAccess denied for user 'SYSTEM'@'localhost' (using password: NO)
Code as follows:
<?php
include("DB_Info.php");
class MySQLDatabase
{
public $connection;
function _construct()
{
$this->open_connection();
}
public function open_connection()
{
$this->connection = mysql_connect($DB_SERVER,$DB_USER,$DB_PASS);
if(!$this->connection)
{
die("Database Connection Failed" . mysql_error());
}
else
{
$db_select = mysql_select_db($DB_NAME,$this->connection);
if(!$db_select)
{
die("Database Selection Failed" . mysql_error());
}
}
}
function mysql_prep($value)
{
if (get_magic_quotes_gpc())
{
$value = stripslashes($value);
}
// Quote if not a number
if (!is_numeric($value))
{
$value = "'" . mysql_real_escape_string($value) . "'";
}
return $value;
}
public function close_connection()
{
if(isset($this->connection))
{
mysql_close($this->connection);
unset($this->connection);
}
}
public function query($sql)
{
$result = mysql_query($sql);
$this->confirm_query($result);
return $found_user;
}
private function confirm_query($result)
{
if(!$result)
{
die("The Query has problem" . mysql_error());
}
}
}
$database = new MySQLDatabase();
?>