RE: [PHP] Detecting empty query result?
| From: | Seb Frost | Date: | Tue, 21 Aug 2001 14:03:20 +0000 |
| Subject: | RE: [PHP] Detecting empty query result? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-63705@lists.php.net to get a copy of this message | ||
just use mysql_num_rows($result) dummy :-)
doh.
sorry to bother y'all.
-----Original Message-----
From: Seb Frost [mailto:seb@raceshoot.com]
Sent: 21 August 2001 14:55
To: php-general@lists.php.net
Subject: [PHP] Detecting empty query result?
Basically I want to check to see if $fileDir is already in my database. I
do this as:
$result = mysql_query("SELECT fileDir FROM shoots WHERE
(fileDir='$fileDir')");
How do I check the result? I normally use
mysql_result($result, $row, $field)
to read my result, but if I try that I get an error:
if(mysql_result($result, $row, $field))
gives me:
Warning: Unable to jump to row 0 on MySQL result index 3
cheers,
- seb
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net