sanjay sanjay - 2 months ago 6
MySQL Question

display image whose link is in database

I have links of images in my database e.g.-http://accessories.us.dell.com/sna/images/products/large/330-5288.jpg
above link of an image is in one of the fields of my database. i don't know how to display it in my html page using php. Can any one help?
thnks

Answer

<?php
$sql = "SELECT your_image FROM your_table WHERE your_conditions_here";
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)) {
?>
<img src="<?php echo $row['your_image']; ?>" />
<?php  
}
?>