Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a result of query and use this cycle for get all rows:

while( $r = mysql_fetch_array( $res ) )

OK, but I need get all rows again.
So I want move pointer of result of query to top and repeat cycle again, but how?
So I must make the same query, but this is not good.
Posted

1 solution

When you go through the while loop, build an associative array. This way you save the results to be used again, and don't have to re-query.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900