I\'m thinking about developing my own PHP based gallery for storing lots of pictures, maybe in the tens of thousands.
At the database I\'ll point to the url of the i
I usually just use the numerical database id (auto_increment) and then use the modulu (%) operator to figure out where to put the file. Simple and scalable. For instance the path to image with id 12345 could be created like this:
12345 % 100 = 45
12345 % 1000 = 345
Ends up in:
/home/joe/images/345/45/12345.png
Or something like that.
If you're using Linux and ext3 and the filesystem, you must be aware that there are limits to the number of directories and files you can have in a directory. The limit is 32000 for dirs, so you should always strive to keep number of dirs low.