Thinkphpuploadify how to design the process of submitting a form after uploading an image

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.