Table lookups?

4 posts by 2 authors in: Forums > CMS Builder
Last Post: May 16, 2009   (RSS)

Re: [ncasares] Table lookups?

By ncasares - May 11, 2009

I did some thinking about this over the weekend and here's as far as I've gotten.

I think this can be accomplished with 3 tables:

- Photos
- Categories
- Descriptions

In the Descriptions table there would be 3 fields for description, category and photo number. The category and photo number fields would be looked up from their respective tables.

Each entry in the Descriptions table would be tied to a specific photo. With this relationship is it possible to retrieve the link to the photo based on the photo number?

I'm stuck on the viewer code that would make this happen.

Thanks.

Re: [ncasares] Table lookups?

By ross - May 13, 2009

Hi there.

Thanks for hanging on :).

I am curious if there would be a finite number of categories or would that be changing fairly consistently?

What I am thinking is you could just have a description field on your image section for each category.

Then, when you are on the viewer page, you just need to pull in the appropriate field.

So anytime you are on the category a list page, or detail page, you know to pull in the category a field from your image.

Does that sound like it would work? Let me know what you think ;).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] Table lookups?

By ncasares - May 16, 2009

Hi Ross,
Thanks for taking time to reply. Your solution would work if I only had one description per image. However, each image will have multiple descriptions that are tied to one or more categories.

Essentially, I'm trying to avoid uploading images more than once while being able to list images in multiple categories. Descriptions may or may not be tied to the same categories as the image, but they will be tied to the image.

I've decided to split descriptions into their own table and just connect them to photos via a lookup. It should accomplish the same thing it just makes the editing process 2 steps instead of 1.

Thanks.