checking for results return from mysql
| From: | Jon Yaggie | Date: | Sun, 05 Aug 2001 18:35:56 +0000 |
| Subject: | checking for results return from mysql | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-11079@lists.php.net to get a copy of this message | ||
i suppose this much have a simple solution i am missing. but here is the situation.
i want to checkand see if my query returned any results. problem is if i check liek this -
if($results = mysql_fetch_array($result))
it appears that a resource is returned regardless. so this is always true.
the real problem is that i need to find out if something is returned without actually accessing the
data. because this if statement appears to be calling the first row of result data so later when i
use a while loop to go through the data i am missing the first result returned.
i have tried putting a few other mysql function in the conditional. maybe i am on the wrong path .
. would one of the cariable functions like isset() or soemthing check this?
Thank You,
Jon Yaggie
www.design-monster.com
And they were singing . . .
'100 little bugs in the code
100 bugs in the code
fix one bug, compile it again
101 little bugs in the code
101 little bugs in the code . . .'
And it continued until they reached 0