Re: while loop
| From: | Brian Clark | Date: | Tue, 10 Apr 2001 06:05:34 +0000 |
| Subject: | Re: while loop | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-47956@lists.php.net to get a copy of this message | ||
Hi Zeus,
@ 1:58:56 AM on 4/10/2001, Zeus wrote:
> Isn't the '=' operator suppose to be used for assigning and not for
> evaluation.
In this case, it /is/ used for assignment.
print $row['some_column'];
...
>> > Isn't this suppose to be an infinite loop?
>> >
>> > while ($row is assigned to mysql_fetch_array($query)) {
>> > do stuffs;
>> > }
>> >
>> > someone correct me if I'm wrong?
...
>> Consider yourself corrected :-) mysql_fetch-array returns an array
>> corresponding to the fetched row, or _false if there are no more rows_
>>
>> So as soon as there are no more rows, $row = mysql_fetch_array($query)
>> evaluates to false and the while exits.
>>
>> --
>> David Robley | WEBMASTER & Mail List Admin
...
-Brian
--
PGP is spoken here: 0xE4D0C7C8
Please do not carbon copy me on list replies.