note 27069 added to function.mysql-query

From: Date: Thu, 21 Nov 2002 19:18:59 +0000
Subject: note 27069 added to function.mysql-query
Groups: php.notes 
Request: Send a blank email to php-notes+get-39830@lists.php.net to get a copy of this message
I am doing a search page, and it outputs the results correctly. I would like it so that if no results are returned, I would like to say No results returned. Unfortunatley I am rather new at this and am not sure how to check for an empty set. here's what I have thus far: $result=mysql_query($query) or die("d'oh! query failed, master! what shall I do now?"); while ($line = mysql_fetch_array($result, MYSQL_NUM)) displays results line by line So far it works fine just displaying. but the while loop does not run if their is an empty set. -- http://www.php.net/manual/en/function.mysql-query.php http://master.php.net/manage/user-notes.php?action=edit+27069 http://master.php.net/manage/user-notes.php?action=delete+27069 http://master.php.net/manage/user-notes.php?action=reject+27069

« previous php.notes (#39830) next »