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

Recommended Answers

All 3 Replies

Member Avatar for diafol

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']}\" />";

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

Member Avatar for diafol

I have no idea what you're talking about. Maybe try the Joomla forum.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.