logo
WSN Links PHP Directory Software
Features Showcase Reviews Demos Purchase Manual Support
 

search.php code question

Version: 4.1.6


search.php code question
rw
Experienced

Usergroup: Customer
Joined: Jul 29, 2005
Total Topics: 27
Total Posts: 62
Posted 10/19/07 - 09:41 AM:
quote post
#1
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))"
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 55
Total Posts: 5786
Posted 10/19/07 - 02:36 PM:
quote post
#2
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.

Edited by Paul on 10/19/07 - 02:40 PM
Search thread for
Download thread as


You don't have permission to post.

Please login or register.

Admin Control Panel

   
Home    |    Features    |    Showcase    |    Reviews    |    Demos    |    Purchase    |    Manual    |    Support
© 2008 Paul Knierim. All rights reserved.