persistent results?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
inan
Forum Newbie
Posts: 1
Joined: Sun Nov 17, 2002 12:41 am

persistent results?

Post 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?
MeOnTheW3
Forum Commoner
Posts: 48
Joined: Wed Nov 13, 2002 3:28 pm
Location: Calgary, AB

Post 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.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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.
Post Reply