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
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???
Link to comment
Share on other sites

Ì 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??
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.