search

Home  >  Q&A  >  body text

mysql - thinkphp3.2.3 uploads multiple images and passes them to three fields of the same data table

I want to upload three pictures at the same time in one form, and upload them to three fields in the data table, namely preview1, preview2, preview3, but now only one picture can be uploaded. I would like to ask everyone for help. How should it be modified?
1. Front-end page

2. Backend code

< /p>

3. Database table

< /p>

伊谢尔伦伊谢尔伦2867 days ago586

reply all(4)I'll reply

  • 迷茫

    迷茫2017-05-16 13:03:00

    Is it because there is no multiple attribute in your front-end input?

    reply
    0
  • 黄舟

    黄舟2017-05-16 13:03:00

    I suggest you write it in the form of asynchronous upload, then create three hidden inputs, and combine the uploaded image addresses and put them into the three inputs.

    It is now very convenient to upload pictures asynchronously, unlike before.


    If it is really not asynchronous, then you need to use a loop when processing on the backend, upload them one by one, and then combine the addresses and submit them to the database.

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-16 13:03:00

    There is documentation here: http://document.thinkphp.cn/m...

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-16 13:03:00

    Why not use asynchronous multi-image upload? Not only it’s easy to use, but also worry-free.

    reply
    0
  • Cancelreply