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

Link to comment
Share on other sites

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.

 

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

 

Yes.

 

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.