Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 618865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:35:35+00:00 2026-05-13T18:35:35+00:00

This is an architecture question, but its solution lies in ColdFusion and MySQL structure–or

  • 0

This is an architecture question, but its solution lies in ColdFusion and MySQL structure–or at least I believe so.

I have a products table in my database, and each product can have any number of screen-shots. My current method to display product screen-shots is the following:

I have a single folder where all screen-shots associated with all products are contained. All screen-shots are named exactly the same as their productID in the database, plus a prefix.

For example: Screen-shots of a product whose productID is 15 are found in the folder images, with the name 15_screen1.jpg, 15_screen2.jpg, etc…

In my ColdFusion page I have hard-coded the image path into the HTML (images/); the image name is broken into two parts; part one is dynamically generated using the productID from the query; and part two is a prefix, and is hard-coded. For example:

<img src"/images/#QueryName.productID#_screen1.jpg">
<img src"/images/#QueryName.productID#_screen2.jpg"> etc...

This method works, but it has several limitations the biggest listed bellow:

  1. I have to hard-code the exact number of screen-shots in my HTML template. This means the number of screen shots I can display will always be the same. This does not work if one product has 10 screen shots, and another has 5.
  2. I have to hard-code image prefixes into my HTML. For example, I can have up to five types of screen-shots associated with one product: productID=15 may have 15_screen1.jpg, 15_screen2.jpg, and 15_FrontCover.jpg, 15_BackCover.jpg, and 15_Backthumb.jpg, etc…

I thought about creating a paths column in my products table, but that meant creating several hundreds of folders for each product, something that also does not seem efficient.

Does anyone have any suggestions or ideas on the correct method to approach this problem?

Many thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:35:36+00:00Added an answer on May 13, 2026 at 6:35 pm

    How about…

    use an Image table, one product to many images (with optional sortOrder column?), and use imageID as the jpeg file name?

    update:

    Have a ImageClass table, many Image to one ImageClass.

    Image
    -----
    ID
    productID
    imageClassID (FK to ImageClass)
    

    Use back-end business logic to enforce the some classes can only have one image.

    Or… if you really want to enforce some classes can only one image, then can go for a more complex design:

    Product
    ------
    ID
    name
    ...
    frontCoverImageID
    backCoverImageID
    frontThumbImageID
    backThumbImageID
    
    Image
    -----
    ID
    productID
    isScreenShot (bit)    // optional, but easier to query later...
    

    However, I like the first one better since you can have as many classes you see fit later, without refactoring the DB.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This might seem like a stupid question I admit. But I'm in a small
This is a difficult and open-ended question I know, but I thought I'd throw
I don't have a specific question here but I'm more looking for some guidance
Not sure this is an architecture question or not, please fix if i am
I've asked this question on some places but I never get a completely straight
I'm just finishing up a computer architecture course this semester where, among other things,
I initially designed my system following the s# architecture example outlined in this codeproject
This is a bit of a long shot, but if anyone can figure it
This is kinda oddball, but I was poking around with the GNU assembler today
This question is related to my question on existing coroutine implementations in Java .

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.