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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.