is there anyway to return an array of strings that corresponds to the fetched row one by one?
Basically, if I want to retrieve all rows from my database, I do something like this:
$.post('my_script.php', {id:id}, function(data){
$('#container').html(data);
});
my_script.php
<?php
$id = $_POST['id'];
$query = "SELECT image_name FROM my_list WHERE id=$id";
if($mysql_query = mysql_query($query)){
while($mysql_fetch_assoc = mysql_fetch_assoc($mysql_query)){
$mysql_result_name = $mysql_fetch_assoc['image_name'];
echo "<img src='".$mysql_result_name."'/>";
}
}
?>
The problem about this is that, it will show a blank page for couple of second as long as this statement (while($mysql_fetch_assoc = mysql_fetch_assoc($mysql_query))) is not finished. This is definitely not good for the users. I want at least to display the image one by one if they are ready to be displayed.