In database multiple image name is stored with comma separation and image is stored in upload folder.Now I want retrieve the data from db using explode function. what I have done so far,My page view source is returning this.I dont know where I went wrong. kindly guide me. In db the image stored like this. Lighthouse.jpg,Penguins.jpg,Tulips.jpg. I have used foreach in while loop.shall i want to use foreach or with the help of while loop itself we can retrieve the data
My page view source is returning this
<img src="upload/L" />
<img src="upload/P" />
<img src="upload/T" />
here is my php code
<?php
$sub=mysql_query("select iname from properties ps ");
while($listnew=mysql_fetch_array($sub))
{
$res = explode(",", $listnew['iname']);
foreach ($res as $item) {
?>
<img src="<?php echo "upload/".$item['iname'];?>" />
<?php
}
}
?>