Re: Re: Passing by conditional IF statement...why?
| From: | Ryan A | Date: | Tue, 23 Mar 2004 03:07:14 +0000 |
| Subject: | Re: Re: Passing by conditional IF statement...why? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-181224@lists.php.net to get a copy of this message | ||
Hey John,
Yep, this is just for one row as I need to know which file before I force a
download.
This is for people selling ebooks, MP3s etc
I usually use a while loop if I need multiple rows returned.
Cheers,
-Ryan
On 3/23/2004 3:07:14 AM, holmes072000@charter.net wrote:
> Ryan A wrote:
>
> > if(($r = mysql_fetch_row($res)) >=1)
>
> if($r = mysql_fetch_row($res))
>
> will work fine if you only have one row being returned. If you have more
> than one that you need to loop through, then:
>
> if($r = mysql_fetch_row($res))
> {
> do
> {
>
> }while($r = mysql_fetch_row($res));
> }
>
> Now you have the added efficiency of not having to call mysql_num_rows()
> (if you don't need that value).
>
> --
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> php|architect: The Magazine for PHP Professionals - www.phparch.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php