Jump to content

displaying images in a table


debcous

Recommended Posts

I'm trying to display images in a table. The way that I have my images stored is that I have the name of the image stored in my database. I then have a variable ($imagepath) which stores the the directory of the image and the name of the image.

[code]
$imageDir = "http://snet.wit.ie/~debcous/clothes/";
$imagePath = $imageDir."".$image;[/code]

. I am displaying details in the table as follows:

[code]
<td align="center">'.$row['.$imagepath.'].'</td>
<td align="center">'.$row['prodName'].'</td>
<td align="center">'.$row['price'].'</td>
[/code]

But it is not displaying the image. Any clues???
Link to comment
https://forums.phpfreaks.com/topic/7942-displaying-images-in-a-table/
Share on other sites

Thanks Andy. I am trying to display the images dynamically so I cannot hard code the full address. I have now changed it so that it is [code]

<td align="center"><img src="http://snet.wit.ie/~debcous/clothes" ></td>[/code]

how do I append the image field which stores the image name in my db to the end of it???
Ì have actually gotten it to display out the image now by using

[code]
<img src="http://snet.wit.ie/~ciaracousins/clothes/'.$image.'[/code]

but the problem is it is displaying out the very 1st image that I have stored in my db in every field. The prod name and price are different in every row but the image is staying the same? Any ideas why this is happening??

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.