Multi-image Upload image address storage problem
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!
Multi-image upload
Share to:
------Solution--------------------
Table PHOTOS
PID image ID self-increment
TID Post ID
Photoname picture file name
SELECT * from PHOTOS where tid= $tid
------Solution--------------------
$a = glob (' Upload folder/* ');
$FN = end ($a); The last file name to upload
------Solution--------------------
1. Field Rule Storage Example/images/1.jpg::::/images/2.jpg or direct Json_encode
2. Storage folder
------Solution--------------------
Multiple picture addresses separated by commas, Ming?
------Solution--------------------
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.
------Solution--------------------
Recommended to store a time, a record of a picture, storing is the URL address, can be relative to the path