I have a result set I pull from a large database:
$result = mysql_query($sql);
I loop through this recordset once to pull specific bits of
Use:
mysql_data_seek($result, 0);
You get this "free", since it's already buffered.
As a separate note, you can explicitly do an unbuffered query with mysql_unbuffered_query.
Using SQL Cursors you can get this approach