It's not testing for equivilance, it's assigning a value and testing for whether there are any more rows left to fetch (at which point the whole expression becomes false and the loop terminates).
I also find it a little counterintuitive which is why I usually use for loops instead of while loops for that, but while is a shorthand when there's no real need to keep track of the row number.
0/5
1
2
3
4
5
This thread is closed, so you cannot post a reply.
Comments on search.php code question
Experienced
Usergroup: Customer
Joined: Jul 29, 2005
Total Topics: 30
Total Comments: 65
We found in search.php on line 189 version 4.1.6 and prior is it correct?
Line reads:
"while ($linkrow = $db->row($dolinksearch))"
This appears to be testing equivalence and likely wants to use the equal == operator as in:
"while ($linkrow == $db->row($dolinksearch))"
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
It's not testing for equivilance, it's assigning a value and testing for whether there are any more rows left to fetch (at which point the whole expression becomes false and the loop terminates).
I also find it a little counterintuitive which is why I usually use for loops instead of while loops for that, but while is a shorthand when there's no real need to keep track of the row number.