RE: [PHP] Bizarre SQl, if issue....
| From: | Mike At Spy | Date: | Tue, 29 Jul 2003 18:49:55 +0000 |
| Subject: | RE: [PHP] Bizarre SQl, if issue.... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-157381@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Jay Blanchard [mailto:jay.blanchard@niicommunications.com]
> Sent: Tuesday, July 29, 2003 2:41 PM
> To: Mike At Spy; php-general@lists.php.net
> Subject: RE: [PHP] Bizarre SQl, if issue....
>
>
> [snip]
> > I still want to know what you need to do, test for query execution or
> > value? It is pretty cut and dried after that.
>
> Value. If there is nothing found in the table that matches, do one
> thing.
> If there is, do another. :)
> [/snip]
>
> Then you must test for something returned, not whether or not the query
> executed. Use mysql_num_rows($person);
I did! Look at this again:
$which_person = mysql_query("SELECT ID FROM tblItems WHERE number =
$place");
$vthere = mysql_num_rows($which_person);
if ($vthere == '0') { True } else { False }
Yet it still returns as if this is FALSE (i.e. it executes the else {}. :\
:\
-Mike