hi, i am getting a error and i can’t find anything related to it on net. what i m doing is inserting a value manually and then displaying it to show. it works fine till insert but when it gives me error on mysql_fetch_array(). here is my code
$sql = "SELECT * FROM users WHERE id=1";
$result_set = $database->Query($sql);
$found_user = mysql_fetch_array($result_set);
echo $found_user['username'];
public function Query($sql){
mysql_query($sql,$this->con);
}
}
public function OpenConnection(){
$this->con = mysql_connect(DB_server,DB_username,DB_password);
if(!$this->con){
die ("Cannot connect to database because " .mysql_error());
}
}
where am i going wrong?
there error i get is
mysql_fetch_array() expects parameter 1 to be resource, null given