I think indentation is messed here since this } belongs to "if (!$row) {"