girl Posted March 31, 2013 Share Posted March 31, 2013 Hi all.I have a question. I want to upload an image using php and insert it into mysql table. I think I can do it with move_uploaded_file, but I don know how to write the destination to mysql table.Thanks. Link to comment Share on other sites More sharing options...
Don E Posted March 31, 2013 Share Posted March 31, 2013 You can move the image to your desired location/directory using move_upload_file but to store in the database table, you can store the image names themselves like mypic.jpg and then when you want to display the images on a webpage, you can retrieve the image names from the database table and set them to <img> tag to be displayed on the webpage. You can also store the actual image(s) itself in the database too but personally I prefer the above method. Link to comment Share on other sites More sharing options...
thescientist Posted April 2, 2013 Share Posted April 2, 2013 to supplement, you will need to use SQL commands to get whatever it is, (path, glob) into the DB.http://www.w3schools.com/php/php_mysql_intro.asp#gsc.tab=0 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now