Hello, I have some code that works, but is clunky and am wondering if there is a better way to do it, first the code, and then i will explain:
// repeat query 10 times
for ($i = 1; $i <= 10; $i++) {
$query = @mysql_query("SELECT fileName FROM images");
while($row = mysql_fetch_assoc($query)){
extract($row);
echo "<img src='images/images/$fileName'/>";
}
}
I would like to repeat a set of images whose file names are stored in a mySql table. The code above repeats the query 10 times. I would rather query once, then repeat the list. Is there a way to do this, either on the mySql side or in the php loop?
Thanks.