AEllerbrock Posted January 22, 2012 Share Posted January 22, 2012 I'm building a website in which the user can upload 3 photos of the same product (from different angles). what i want is that the user only selects those 3 iamges, writes a description and when they press upload the system creates an album named "1" with the 3 images in it. the next time the new folder name will be "2" I tried storing them on a mysql database but i read it makes it too heavy and the queries take longer. so i'll just save the path there. thanks! Link to comment https://forums.phpfreaks.com/topic/255517-how-can-i-make-folders-with-auto-incrementing-int-names/ Share on other sites More sharing options...
litebearer Posted January 22, 2012 Share Posted January 22, 2012 do your users have a unique id in your database? Link to comment https://forums.phpfreaks.com/topic/255517-how-can-i-make-folders-with-auto-incrementing-int-names/#findComment-1310025 Share on other sites More sharing options...
AEllerbrock Posted January 22, 2012 Author Share Posted January 22, 2012 no, its a client who stores photos about his products and i have to show it on my site. Link to comment https://forums.phpfreaks.com/topic/255517-how-can-i-make-folders-with-auto-incrementing-int-names/#findComment-1310026 Share on other sites More sharing options...
litebearer Posted January 22, 2012 Share Posted January 22, 2012 how many different products from each client/user? Link to comment https://forums.phpfreaks.com/topic/255517-how-can-i-make-folders-with-auto-incrementing-int-names/#findComment-1310028 Share on other sites More sharing options...
jcbones Posted January 22, 2012 Share Posted January 22, 2012 Does the client Log In? I would suggest that you create a folder for each client in your image folder. Then create a new unique name for the image (be careful of collisions). Maybe a random string, then hashed. Insert the file name into the database, tying it back to the user's table. If you put 3 images into each folder, that would create a mess of folders, I would keep them all in one. Link to comment https://forums.phpfreaks.com/topic/255517-how-can-i-make-folders-with-auto-incrementing-int-names/#findComment-1310123 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.