Categories SQL PHP MySQL Query based on number of results returned Post author By Stephen H Post date October 25, 2013 $sql = "SELECT * FROM tbl"; $result = mysql_query($sql); if (mysql_num_rows($result)==0) { //do this } else { //do that } ← Returning the Last Insert Id Zend Framework → PHP short of statement (Ternanry)