Jump to content

How to associate image upload with other data


geroid

Recommended Posts

Hi

I'm just looking for some advice on uploading images before I start the work. I'm doing a website for some people. They will get to upload information about events that they run to a database. They would also like to upload images relating to these events. I have a form which allows them to upload the event info into the database and this dynamically appears on the webpage. My query is:

1. How do I associate the images that they upload with a particular record?

2. Could I, for example, save the event record and then save the image path in a seperate table with the event record id so as to link and retreive them

 

Do you think this is the best way to do this.

Also what do I do to allow them to upload any number of images and relate them to a single  event record.

As I say it's just a query at the moment. I don't want to waste time going down the wrong path

Thanks for any advice

  Quote
Could I, for example, save the event record and then save the image path in a seperate table with the event record id so as to link and retreive them

 

Yes. Thats answers your first question.

 

  Quote
Do you think this is the best way to do this.

 

Yes.

 

  Quote
Also what do I do to allow them to upload any number of images and relate them to a single  event record.

 

Just add more paths to your image table, using the same article id to relate them.

Ok it's beginning to come together. I guess I'll have lots of questions when I begin but one that comes to mind now is this.

If I allow them to upload any number of images per event record - so one event might have one image associated with it, another might have 2, another 3 or even none.

How might I plan to design my webpage to accomodate this? If there are no images for an event I don't want a big blank square on the page etc. How will I detect the number of images and dynamically display them on the webpage.

 

Just a query for now though.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.