The value of $result_row is probably set to the logical condition of whether mysql_fetch_assoc($query) returns something true-ish and $s less than 5. Therefore, trying to read $result_row as a dictionary no longer works.
You can use parentheses to pinpoint how things are sorted:
while (($result_row = mysql_fetch_assoc($query)) && ($s < 5))
So $result_row gets the mysql_fetch_assoc($query) value that you need, and the loop continues until the boolean value of this assignment returns something true, and also s less than 5.
Mike christensen
source share