Hi there I'm using a function to check user messages but right now I am unable to get it work.
error: Fatal error: Call to a member function fetch_array() on a non-object
public function HasMessageReadData($id)
{
$GLOBALS['mysqli']->query("use ".$GLOBALS['db_ucp']."");
$stmt = $GLOBALS['mysqli']->prepare("SELECT COUNT(*) FROM message_read WHERE msg = ? AND id = ?");
$stmt->bind_param("ii", $id, $this->id);
$stmt->execute();
$message = $result->fetch_array(MYSQLI_BOTH);
if($message[0] > 0)
return true;
else
return false;
}