PDA

Click to See Complete Forum and Search --> : Move to first record after loop


StrangerInBeijing
Jun 24th, 2008, 11:57 PM
I do a query, and loop through the result and build a select list from it.

Thing is I wan to use this result over and over so just want to get it once, then do a "while($row = $results->fetch_object()) " several times.

But seems after you did it once you cant loop through the results again.

Remember sth in .net and vb6 like recordset.movefirst....is there and equivalent in php / mysqli ?

srisa
Jun 25th, 2008, 04:43 AM
$results->data_seek(0); before the next loop.