0

hi i have images saved in a folder, the referrence id and imagename of that images are saved in database in the way as shown below...

id filename
--- --------
1 flowers1.jpg
2 flowers2.jpg

the folder is on the root directory on images folder as ../images/gallery/flowers
now how i can i get the image from that folder to dispaly on webpage with the help of id from database.I want something related to joomla,php,mysql.Any help....?

Edited by Layerphp: n/a

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by diafol
0

The SQL

SELECT filename FROM dbtable WHERE id = $id

The extraction into $row array (the filename held in $row).

Now for display:

<img src="images/gallery/flowers/<?php echo $row['filename'];?>" />

or if you put everything into php:

echo "<img src=\"images/gallery/flowers/{$row['filename']}\" />";
0

Hi thanks for the reply but i have my photos stored in a folder inside ignite gallery plugin, so from there how to retrive them..?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.