copy mysql_query resource result

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
orlandinho
Forum Newbie
Posts: 18
Joined: Mon Feb 12, 2007 9:50 pm

copy mysql_query resource result

Post by orlandinho »

hi

i have a little problem with results of mysql_query
i want to use the result of a mysql_query more than one time
i tried to do this:

Code: Select all

$result=mysql_query('SELECT * FROM EMP');
$temporal_result=$result;
it doesn´t work
also tried this:

Code: Select all

$result = $temporal_result = mysql_query('SELECT * FROM EMP');
it doesn´t work

what i did temporaly was execute the query twice, which is not a optimal solution

how can i reuse or manipulate a result from a query
i kwon it´s a resource but i didn´t found much info about it

i´d appreciate any help
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Post Reply