View Full Version : Repeat region - php mysql images with links

07-09-2009, 03:09 AM
This is what I am trying to do:
Create a list on my site that can be sorted by each column (I can do this part)

Now...this is where I am stuck

One column is going to contain an image (with link). The image will NOT be stored on the local host. So essentially it is a link to the image. The image will also be clickable so I need that link embedded also.

The image will change (by the origin host) from time to time, so that is why it is not stored locally.

Any ideas of where I could find a good tutorial? Or is it easy enough you could just describe it here? I don't want to do the code by hand, so I am looking for instructions for Dreamweaver. And like I said, I already know how to do the list with the repeat regions and sorting by columns.


07-09-2009, 03:24 AM
you wont be able to do this without some hand coding. that is not part of the dw wizard , what will be stored, the image name or the image name and folder?
in either case you need to echo the field contents into
<a href="<?php echo $row['field']: ?>" >
<img src="
<?php echo $row['field']: ?> "
where change $row and field to whatever names name you used

07-09-2009, 03:32 AM
My problem is that I don't know the code very well...just learning

There will be a column called "Image Link" or whatever

And then I would have some code like this...

<a href="http://www.anrdoezrs.net/click-3543464-10494547" target="_top">
<img src="http://www.tqlkg.com/image-3543464-10494547" width="468" height="60" alt="Download 25 FREE songs at eMusic.com!" border="0"/></a>

(Affiliate link)

07-09-2009, 04:28 AM
image-3543464-10494547 isnt an image though it will need an extension gif, jpeg or what ever.
what data will actually be in your database?

07-09-2009, 06:11 PM
That is the affiliate link code. I can also use the javascript code. That would be in the first column. It would display the image on the site. Basically it is embedded code. The remaining columns would have information about the product (text).

Why don't I just use a table and make it a whole lot easier? Because I want to be able to sort the record in the database and display them based on the text. Alpha order, cheapest to most expensive, etc.

These would be the columns (as examples)

Affiliate link code (like that above)
Business name
Monthly rate
category (this wouldn't be displayed, but used for sorting)