Hi there PHP forum DP members, I got few questions about PHP image upload script, as the title says... I searched many upload script and I haven't seen any upload script using any SQL, I know it is possible(with or without the use of database), but what is the best way to do this image upload script thingy, through storing the dir address in a SQL table or through making a dir for an image and use the file functions to search for that image, I mean, I am really confused right now, can u give me any sites or posts or blogs or articles or any tutorials that gives a good idea... Probably, I need to study again the image-script I had before... Thanks! Your response would be highly appreciated!
I personally would store the path to the image and the image name in the database. The last thing you want is to have to run multiple queries and other scripts to display an image.
you need to convert img to binary to store in sql, but depending on your db. some db have image variable which takes image directly
Agree with stephan2307. I never understood why some scripts use the DB to store binary data, specially for files. It's much easier, more scalable and has less impact on your db performance to store it as a file on the server.