mysqli_fetch_row () spodziewa się parametru 1 będzie mysqli_result, boolean podany w

change that if statment to

  if(!$result) {
Santino