I retreive data from a mysql db and display it: $images = mysql_query("select * from images"); while($row=mysql_fetch_array($images)) { echo "Image : $row[image]"; } PHP: Now, i want to use result of same query in another part of document. How do i do that ? This doesnt work : while($row=mysql_fetch_array($images)) { echo "Thumbnail : $row[thumb]"; } PHP:
Try to it: $images2 = mysql_query("select * from images"); while($row2 = mysql_fetch_array($images2)) { echo "Thumbnail : $row2[thumb]"; } PHP: