Webmastersite.net
Register Log In

search.php code question

Comments on search.php code question

rw
Experienced

Usergroup: Customer
Joined: Jul 29, 2005

Total Topics: 30
Total Comments: 65
rw
Posted Oct 19, 2007 - 11:41 AM:

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
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Oct 19, 2007 - 4:36 PM:

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.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.