Zend Db Statement - reset loop -


i'm using zend framework 1.12.2 , build query:

$sitessql = 'select * app_sites'; $stmtsites = $db->query($sitessql); 

and want loop throw rows twice.

while ($row = $stmtsites->fetch()) { [...] } 

dozens of lines below

while ($row = $stmtsites->fetch()) { [...] } 

but unfortunately second loop doesnt loop beginning. above second while must reset statement - how? mysqli_data_seek()

can not use fetchall() (which returns array) instead?

$sites = $db->fetchall($sitessql); 

then can loop through results foreach twice:

foreach ($sites ...) {  } 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -