Apache2.
I have a class that acts as the DB layer, of which I pass all objects by reference.
It works like a dream in PHP 4.
Not sure if this is the expected behaviour, or an unwanted side effect.
--- start psuedo snip ---
$sql = 'SELECT * FROM foo'; $result = $obj->do($sql); while(!$result->EOF) { var_dump($result->records());
//$obj2 is another object that accepts the DB layer by reference in the Sanitize method
$bar = $obj2->Sanitize($text, $obj);
}
--- end psuedo snip ---
If the table "foo" has 2 rows to return, it will only return one row.
From what Im seeing so far, $bar = $obj2->Sanitize($text, $obj); , which does another DB action,
is highjacking the original $result, that is supposed to be returning the 2 rows.
If I comment out $bar = $obj2->Sanitize($text, $obj); , the script returns the 2 rows properly.
If uncommented, it only returns one row.
Mind you, the psuedo code works perfectly in PHP < 4.3.3
So far my code breaks in certain places when Im expecting more that one result.
And in each place it breaks, the situation is the same like the code above.
If doing another query inside a loop hijacks the original result.
Im not sure if this is because of passing objects by reference.
Ill do some poking around and see what else I can figure out, but if anyone can give me a heads up from their
past experiences or know of something, please feel free to let me know.
Thanks
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php