Thinkphpuploadify how to design the form submission process after the image is uploaded, such as Question & nbsp; what you want to implement is & nbsp; click upload image & nbsp; Upload multiple images & nbsp; (completed) & nbsp; then fill in other information & nbsp; form submission & nbsp; (completed) there are two tables & nbsp; form info table & nbsp; and & nbsp; attachment table & nbsp; & nbsp; the question is how to design the process of submitting a form after uploading an image using uploadyi thinkphp uploadify
Example
To achieve this, click the image to upload multiple images (completed) and fill in other information forms for Submission (completed)
There are two table form information tables and Attachment Tables.
The question is that I use uploadyify to upload the file and insert it directly into the database.
Fields with image Upload status and corresponding form ID fields are used to determine which form information is used.
The following method is used:
Insert uploadify to the image attachment table of the database and query the ID of the image again)
If there are multiple images, this should return the ID array. in multiple images, is each image a record or a record? is the URL of the record attachment address very long?
Then fill in the form, insert the table in the form, and query again. return the form and enter the record ID (write the record once for one query)
Based on the returned attachment ID, locate the record location in the table. enter the form record. return ID. fill in the form ID field corresponding to the attachment. change the status field of the image at the same time (write once for query)
Is this very bad?
If you see a relational table of a form and an attachment, is it the most common ~
In the relational table, the Form ID corresponds to the ID array of multiple images?
How should I design this? normally ~ Novice Cainiao ~ I don't know how to deal with the process. please kindly advise me ~
------ Solution ----------------------
1. you can add a token to the form to mark the current page and associate the uploaded attachment with the form content.
2. the attachment table can be maintained independently and associated with the form data using the token. it can correspond to multiple records or one-to-one