Need help tying 6 container fields to a single customer record for file upload
I'll try to make this descriptive while being brief:
I have a database with a contact table where each contact gets a unique ID, I have a table with 6 container fields, and the contact_id field to maintain the relationship between the two tables.
Basically what I want to do is be able to upload up to 6 files (hence 6 container fields) per contact record (unique contact_id). If I upload one file, it's fine, when I go back to add subsequent files it's creating another record in the table (based on contact_id) and putting the file there. So in my portal view on the contact record I only see the 1st file uploaded.
How can I set a script to see if the contact_ID exists already so if it does it will upload "file 2" to the same record that "file 1" was uploaded to. And of course if there's no existing record for the contact_id create a new one.
I hope this makes sense, if not I'll rewrite.
Thanks so much.
why limit it to 6? In the table with the containers, not knowing the full layout, have 3 fields - container, contact_ID, container_ID (unique serial)
Link the container table to the contact table by contact_ID - this will let you have any number of containers for a given contact.