Forum Moderators: coopster
Let's say, I'm using a loop:
while($list = mysql_fetch_array($results[result])){
...
}
and then..I need that data one more time:
while($list = mysql_fetch_array($results[result])){
...
}
the problem is the second loop is not visible, I would have to change it to:
while($list2 = mysql_fetch_array($results2[result2])){
...
}
or something like that, but I'm sure there must be a better solution.
thanks.
but... the reason yours didn't work is because once you run through the result once the internal pointer is at the end. To use it again you need to use mysql_data_seek [php.net] before your second loop to reset the internal pointer to the beginning of the result set.