mysqli_fetch_row () espera que el parámetro 1 sea mysqli_result, boolean dado en

change that if statment to

  if(!$result) {
Santino