How to Reuse a MySQL Result Set CodeUnit 15 FEB 2011

To reuse an existing result set returned from a query is actually pretty simple thanks to PHP’s mysql_data_seek function and the fact that mysql_query returns a buffered result set by default.

So essentially all we want to do is rewind the entire pointer right to the start in order to reuse the set.

And to do this?

mysql_data_seek($result, 0);


Related Posts:

About Craig Lotter

South African software architect and developer at Touchwork. Husband to a cupcake baker and father to two little girls. I don't have time for myself any more.