I know this question has been asked before, but I tried eveything and can’t find how it works.
I have a prepared query, and I need to use it twice with two while() loops like this:
$query = $pdo->prepare('SELECT ...');
$query->execute();
while( $results = $query->fetch() ){
// instructions
}
// rewind
while( $results = $query->fetch() ){
// instructions
}
Thanks
Could be as simple as getting all the results on the 1st iteration and loop on the 2nd: