You're extrapolating from the action of PHP functions on PHP variables (i.e., acting on references being passed, but not altering the original variable), and wondering if you could do the same with a database record set.
You are asking, in effect
$result =mysql_query ("SELECT * FROM dual");
messaround($result);
function messaround($theresult);{
//do something with $theresult here; like
$x=mysql_fetch_array($theresult);
while($x) {echo $x[0];
$x=mysql_fetch_array($theresult);}
}
now (I guess you're saying) you'd THEN like to say
$x=mysql_fetch_array($result);
and have the original first row $result retuned?
It's a nice idea, but I don't think it's happening.
The record set is a database object being accessed by a PHP API, right? What is being passed is a pointer to the database object, in effect, not a PHP-only variable.
Any function working on the passed reference would therefore end up acting directly on the database, and not on some PHP- internal variable memory structure.
Therefore I can't imagine that you have left $result intact after messing around with the database object reference passed to your function.
Or have I misunderstood your question?