This is a forum where members new and old can come to ask questions and get info and opinions. It is not a place to advertise your business or have other forms of advertising, whether it be in your posts or signature.

All links in the forum will not be indexed by Search Engines and any unapproved forms of advertising or spam will be dealt with accordingly, deleted, and that member's account banned.

Forums

Overview » Dreamweaver » Display thumbnail images from a database
Reply

Display thumbnail images from a database

Magdolna Szilagyi
Member



Since: 03 Jul 2010
Posts: 5
Posted 04 Jul 2010 07:14:36

I've read your tutorial in page www.dmxzone.com/go?14202 that was :
<img src="../images/thumb_"<?php echo $row_rsImages['ImageFile']; ?> />

This is in case we use a prefix ' thumb_ '.

What about a suffix ? I use: _small.jpg . How can I display thumbnail images from a database in this case ?

Thank You for any help
Maddalena

I've read your tutorial in page www.dmxzone.com/go?14202 that was :
<img src="../images/thumb_"<?php echo $row_rsImages['ImageFile']; ?> />

This is in case we use a prefix ' thumb_ '.

What about a suffix ? I use: _small.jpg . How can I display thumbnail images from a database in this case ?

Thank You for any help
Maddalena
Patrick Woldberg
Official Representative



Since: 11 Feb 2003
Posts: 1,894
Replied 05 Jul 2010 11:07:23
is it always a jpeg?

you could try:

<img src="../images/<?php echo substr($row_rsImages['ImageFile'], 0, -4); ?>_small.jpg" />


the substr function just strips off the last 4 characters, a more secure way is to search for the last dot, but I think mostly the files have an extension of 3 charaters, 4 including the dot.

Reply to this topic

Message
Reply
Follow us on Facebook Follow us on twitter Subscribe to the RSS feed
Activate your free membership today | Login | Currency