i am getting error like mysql_connect() acces denied for system@localhost(using password NO)
<p>
    

<pre><code>class MySQLDatabase
{
    public $connection;
    function _construct() { $this-&gt;open_connection();}
    public function open_connection()
    {$this-&gt;connection = mysql_connect(DB_SERVER,DB_USER,DB_PASS);
        if(!$this-&gt;connection){die("Database Connection Failed" . mysql_error());}
        else{$db_select = mysql_select_db(DB_NAME,$this-&gt;connection);
            if(!$db_select){die("Database Selection Failed" . mysql_error());    }
        }}
          public function close_connection({  if(isset($this-&gt;connection)){
            mysql_close($this-&gt;connection); unset($this-&gt;connection);}}
    public function query(/*$sql*/){ $sql = "SELECT*FROM users where id = 1";
        $result = mysql_query($sql); $this-&gt;confirm_query($result);
        //return $result;while( $found_user = mysql_fetch_assoc($result))
        {
         echo $found_user ['username'];
        }

    }
    private function confirm_query($result)
    {
        if(!$result)
        {
            die("The Query has problem" . mysql_error());
        }
    }

}

$database = new MySQLDatabase();
$database-&gt;open_connection();
$database-&gt;query();
$database-&gt;close_connection();

?&gt;
</code></pre>
