Link to home
Start Free TrialLog in
Avatar of clonmelog
clonmelog

asked on

Reading and displaying images from an access database in dreamweaver mx using Coldfusion mx

Hi, I am trying to display images from an access database in a coldfusion page using dreamweaver. I have over 400 images stored in a folder called 'images' in the root folder. There are 24 categories, and have a naming convention like so, eg: ani001, ano002, brb001, etc. I need to be able to display the images one by one, when you select a category. All the images at the moment are appearing on the page in image boxes with an 'X' in them...the actual images themselves are not being displayd. What I need is to be able to select a category, eg: 'Animals', and the images in this category will display one by one when i click on a forward and back button on the coldfusion page.
The access database is also stored in the root folder, and called 'databaseproject.mdb'. the two tables concerned with the images are called 'Categories' and 'Tattoos'. For example, in the 'Categories' table, one of the 'CategoryName' (field) is called 'Animals' (record). And in the 'Tattoos' table, the field is called 'Image' and the records are named like so, ani001, ani003, ani004 etc.
here is the code I have at the moment, which is in a coldfusion page called 'query.cfm'.
<cfquery name="query" datasource="databaseproject.mdb">
SELECT * FROM Animals
<img src="images/#query.Image#">
</cfquery>

Actually, I have checked again and this code is not working now at all!!
Thanks
ASKER CERTIFIED SOLUTION
Avatar of kkhipple
kkhipple

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mrichmon
mrichmon

kkhipple, it sounds to me like it is already not in the access DB.

clonmelog, kkhipple is correct that if that is your only code then you need to move the <img> tag outside of the query and also notice how he changed the name of the query to sel_image?  You cannot use "query" as the name of the query - it is a reserved word.