I'm tierd of FETCHING
Posted: Sat Jul 08, 2006 3:16 pm
Hi Guys,
I have a bit of a problem. Like most people I like to use mysql_fetch_array($result, MYSQL_ASSOC))
in combination with a While loop to print out data.
The problem is that I want to use the fetch function twice on the same result, to print two different tables
and as you know by the time the first one is done the fetch function will return false.
I "solved" the problem like this:
But that doesn't look very pretty, and isn't very efficient.
Is there a way of re-setting the pointer so that I can re-use the fetch function on the same
result? Or is there some other solution.
Cheers!
Mikael
I have a bit of a problem. Like most people I like to use mysql_fetch_array($result, MYSQL_ASSOC))
in combination with a While loop to print out data.
The problem is that I want to use the fetch function twice on the same result, to print two different tables
and as you know by the time the first one is done the fetch function will return false.
I "solved" the problem like this:
Code: Select all
$result = mysql_query($query)
$result2 = mysql_query($query)Is there a way of re-setting the pointer so that I can re-use the fetch function on the same
result? Or is there some other solution.
Cheers!
Mikael