Upload Picture File Paths to Database Without Creating Multiple Records and Giving The Files Random Names

Posted by user1830990 on Super User See other posts from Super User or by user1830990
Published on 2012-11-17T00:02:52Z Indexed on 2012/11/17 11:09 UTC
Read the original article Hit count: 243

Filed under:
|

I want to be able upload pictures to a folder and their filepaths to a MySQL database without creating multiple records.

For example instead of:

id    PicturePath                  size
1     file1.jpg                    90832
2     file2.jpg                    84593

I want to do:

id    PicturePath1                 PicturePath2                 PicturePath3
1     file1.jpg                    file3.jpg                    file5.jpg  

And also as it uploads, it should change the name of the original file e.g. if User uploads DSC0009.jpg it should upload into the file upload folder and MySQL Database as: someRandomFileName8087935.jpg

© Super User or respective owner

Related posts about php

Related posts about mysql