RE: [PHP] test for empty $result??

2001-09-10 Thread Boget, Chris
> Then you can use: > if (mysql_num_rows($result) == 0) { > stuff here > } > This will check the number of rows returned from your query. If zero, > then do somethingmodify as you need. What I generally do is this: if(( !$result ) || ( mysql_errno() > 0 )) { // error code here } OR

RE: [PHP] test for empty $result??

2001-09-10 Thread Andrew
cool! thanks Sam and Jeff, for your responses! best, a > -Original Message- > From: Sam Masiello [mailto:[EMAIL PROTECTED]] > Sent: Monday, September 10, 2001 1:48 PM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: RE: [PHP] test for empty $result?? > >

RE: [PHP] test for empty $result??

2001-09-10 Thread Sam Masiello
] -Original Message- From: Andrew [mailto:[EMAIL PROTECTED]] Sent: Monday, September 10, 2001 1:45 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [PHP] test for empty $result?? thansk, but $result here is a Resource ID, and will be present even if the result set associated with it is

RE: [PHP] test for empty $result??

2001-09-10 Thread Andrew
D] > Subject: RE: [PHP] test for empty $result?? > > > Just use: > > if (!$result){ > code here > } > > Jeff > > > -Original Message- > > From: Andrew [mailto:[EMAIL PROTECTED]] > > Sent: Monday, September 10, 2001 1:34 PM > > To: [EMAIL

RE: [PHP] test for empty $result??

2001-09-10 Thread Jeff Lewis
Just use: if (!$result){ code here } Jeff > -Original Message- > From: Andrew [mailto:[EMAIL PROTECTED]] > Sent: Monday, September 10, 2001 1:34 PM > To: [EMAIL PROTECTED] > Subject: [PHP] test for empty $result?? > > > I know that this has been discussed b

[PHP] test for empty $result??

2001-09-10 Thread Andrew
I know that this has been discussed before, but I cannot find the threads so... I have a function that does a mysql_query and want to break if the SQL query didn't return any rows in $result. empty(), isset() will not work, for obvious reasons. Can anyone suggest an alternative? $sql="select r