RE: [PHP] Bizarre SQl, if issue....

From: Date: Tue, 29 Jul 2003 18:00:47 +0000
Subject: RE: [PHP] Bizarre SQl, if issue....
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-157355@lists.php.net to get a copy of this message
Off hand, I would agree. And that is what I would expect. However, the *exact* same setup on a different server gives me a result of 'FALSE' properly. The other server has php 4.3.3 on it - the one giving the improper response has php 4.1.2. Could this be the issue? -Mike > -----Original Message----- > From: Ford, Mike [LSS] [mailto:M.Ford@lmu.ac.uk] > Sent: Tuesday, July 29, 2003 1:47 PM > To: 'Mike At Spy'; php-general@lists.php.net > Subject: RE: [PHP] Bizarre SQl, if issue.... > > > > -----Original Message----- > > From: Mike At Spy [mailto:spycobalt@spyproductions.com] > > Sent: 29 July 2003 18:37 > > > > > > > $person = mysql_query("Some Statement Here"); > > Please go back and read the manual page for mysql_query again > (http://www.php.net/mysql_query). > > The above returns FALSE if the query is invalid, or a resource_id > you can use to fetch the result (or information about it). So > most likely $person is now a MySQL resource id that doesn't match > any of the conditions in your if statement, and also (more > importantly) doesn't tell you whether you have an empty set or > not. I'd suggest mysql_num_rows() for that. > > Cheers! > > Mike > > --------------------------------------------------------------------- > Mike Ford, Electronic Information Services Adviser, > Learning Support Services, Learning & Information Services, > JG125, James Graham Building, Leeds Metropolitan University, > Beckett Park, LEEDS, LS6 3QS, United Kingdom > Email: m.ford@lmu.ac.uk > Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 > >

« previous php.general (#157355) next »