Jump to content

move_uploaded_file


girl

Recommended Posts

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...