Jump to content

need help with image display from database


antonyjohn

Recommended Posts

hai friends

 

 

  i have one problem in my programming.there is a table containing some details of the product with its image..

 

in view section in my php page ,i need to show this image and the rest of the fields in the table in a row...

plzzz help me out on how to do it

hai friends

 

 

  i have one problem in my programming.there is a table containing some details of the product with its image..

 

in view section in my php page ,i need to show this image and the rest of the fields in the table in a TABLE  Row...

plzzz help me out on how to do it

 

 

Note: it shuld be displayed in a table

It'll look something along the lines of:

 

<table>
<tr><td>Var1</td><td>Var2</td><td>Image</td></tr>
<?php
$sql = "SELECT * FROM `yourtable`";
$result = mysql_query($sql) or die(mysql_error());
while($row = mysql_fetch_assoc($result)){
echo '<tr><td>'.$row['var1'].'</td><td>'.$row['var2'].'</td><td><img src="images/'.$row['images'].'" /></td></tr>';
}
?>
</table>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.