Entry
How do I loop twice through a result set from a mysql query? I don't seem to be able to use reset() to reset the pointer to the beginning of the set.
Jul 25th, 2000 13:26
Richard Heyes, Caroline Wise,
Whilst the value returned from a call to either mysql_fetch_row or
mysql_fetch_array is an array, the result set returned by mysql_query()
is not. Therefore reset(), an array function, will not work.
Fortunately there is mysql_data_seek() that can perform a similar
action:
mysql_data_seek($result_id, 0); // Where 0 is the row number.