Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reset mysql pointer back to the first row in PHP?

Tags:

php

mysql

while($row = mysql_fetch_array($result)){ echo $row['id'];}

If I use the above code two times consecutively, the row does not get printed twice.

How to reset it?


1 Answers

use mysql_data_seek. This function will allow you to move the internal result pointer.