Multi-image Upload image address storage problem

Source: Internet
Author: User
Tags ming
Multi-image upload

Multi-image upload, click to add a picture can be added, the number can not be limited,
I've been trying to figure out how to save a picture, because I have no limit to the number of pictures in a piece of data, can not do 10 million fields in advance?
There is another I think of, but do not do, is to traverse the uploaded folder, upload remember the new folder name on the line, this will not do.
How do we all do this, pointing fingers ah!


Reply to discussion (solution)

Table PHOTOS
PID image ID self-increment
TID Post ID
Photoname picture file name

SELECT * from PHOTOS where tid= $tid

What do you mean by your answer, great God? Take a closer look at the problem, okay?

$a = glob (' Upload folder/* ');
$FN = end ($a); The last file name to upload

Xuzuning said a little deep, explain it again, okay?
What's the best way to save a picture, directly in the directory or in MySQL?

1. Field Rule Storage Example/images/1.jpg::::/images/2.jpg or direct Json_encode
2. Storage folder

Multiple picture addresses separated by commas, Ming?

A field stores information about a picture, and you can place the path of multiple graphs into JSON.
Traverse the file to see the appropriate PHP function.

Multiple picture addresses separated by commas, Ming? A comma exists to prevent users from uploading files. You can rename an uploaded file.

Recommended to store a time, a record of a picture, storing is the URL address, can be relative to the path

  • 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.