I have a form that uploads pdf documents to a table, let’s say ‘tbl_documents_one’. I am using Uploadify to upload those documents which is not a problem for now.
The problem is that I’m new to PHP and am lagging a bit on best practices.
What would be the best practice to link the current form’s table to the documents table. Current form is not submitted yet and the documents would be submitted beforehand, I’d like to make it so that that record of current form would be linked to the documents it contains.
Any way to set up the documents table and the id that would link these two tables and what if the document records are added but never given a proper link or updated.
I’m actually using an Codeigniter 2 rig.
Thanks in advance!
The simple solution for that as far as i understand that you are uploading documents and than submitting form. When you upload documents create a table for these documents which will contain id and nam e and link of that uploaded file.
Than in the form fetch this table data and let user select one document for each form. Your query should contain a flag here Status. if status is set to 1 it means this has already been linked to a form. The default value for this status should be 0. Than query should fatch all those records where status is 0.