I am new to php/mysql. I am trying to store an image in my database via the URL(image location) at the moment my php code is storing the image in a folder in the directory called upload. This is insecure so i want to put the url in a database. My code is based of this IMAGEUPLOAD-WEBSITE Here is a url example generated by my code:
http://www.example.com/imageupload/uploads/medium/uniqueimagename.jpg
- How would i construct a valid table that will store URL’s? Should it be with Varchar?
- How can I retrieve this url from my database and display the image? php query of the filename in the database or original url?
1. How would i construct a valid table that will store URL's? Should it be with Varchar?I wouldn’t store the complete path of the URL into the database. So, if you have:
http://www.example.com/imageupload/uploads/medium/uniqueimagename.jpgI would only store:
2. How can I retrieve this url from my database and display the image? php query of the filename in the database or original url?Just fetch the data from the database and put the raw data in your html