Reputation: 35
I have a html page, with a form and image upload, I want to update the database with the images once uploaded, the two form work well individually, but I need to link the form-data to the uploaded images in the database.
kindly help with logic, I am considering using sessions
Upvotes: 0
Views: 38
Reputation: 447
You can use session as you mentioned or you can updated the relevant record with the next form details.
Say for example, once first form is filled and submited by the user, add those details in database and get the ID of that record. When the second form is submited by the user, update the same record which you have already added for form 1.
So in database you will have only one record for both the forms with all relavent detials.
Upvotes: 1
Reputation: 12095
You could save your images in the session if you don't want to save them in the database (which, by the way, might not be a good idea), this avoids putting stuff in the database that is not yet finally processed (as I understand: this happens when the other form is submitted?)
You could put them in a table for "temporary images" which are not yet processed finally and just keep track of the IDs through the session
Upvotes: 0