Page 1 of 1

persistent results?

Posted: Sun Nov 17, 2002 12:41 am
by inan
I know that external resource references cannot be stored in a session variable, and that persistent database connections essentially remove the need to store a database connection resource, but if there were a way to keep result sets alive in some way it would be extremly helpful.

Has been any discussion or work in this direction?

Posted: Sun Nov 17, 2002 9:39 am
by MeOnTheW3

Code: Select all

<?php
$rsUsers = mysql_fetch_array($result);
?>
$rsUsers now contains the full result of your query as an array.
print_r($rsUsers) will provide you with a look at the structure and indexing.

Posted: Sun Nov 17, 2002 10:11 am
by volka
it only contains the first recordset. If there are more you need to perform a loop like

Code: Select all

while($next = mysql_fetch_array($result))
   $rsUsersї] = $next;
for larger sets and simple querries it might by more reasonable to store the SELECT-string and requery the result as needed.