TO EVERYONE WHO WANTS TO SAVE IN DATABASE: JUST INSERT THE PATH OF THE PHOTO IN THE DATABASE, ECHO IT BACK OUT IN A IMG TAG WITH THE SOURCE EQUALING THE DATABASE ROW
WOW!!! that's so informative… to those who expects mySQL, its actually a tutorial on how to save image to your server. the thing here is that you submitted it online, all you have to do is to add your query on the execution, example: save the image name on a column in your database.. so in summary, u did not saved it in database, u just use it's name to call it… Take note to use the function strtolower() on php to avoid data error… thank you anyway…
…then store the real name for when the file is to be downloaded (for reference).
This is a very very good tutorial and is pretty much all is needed to get going at least. Yes it lacked the final final part for MySQL but if you know how to add data to MySQL then you'll be sorted with this tutorial.
As for the uploaded folders, you will need to create that on the server yourself and reference it in your code. Check the part in the video where it says "move_uploaded_file". "uploaded/" is it.
If it's just a few files in MySQL then that's fine to add to MySQL but in all honesty I'd only store the file information in the database. In order to do that the variables already stored at the start of this video is all that's needed.
The part where the file is uploaded, you take the $name, $size, or other info you need and INSERT it into your database at the same time.
Personally I'd hash the temp filenames for security reasons and use that as the actual uploaded filename…
30 responses to “[HD] PHP Tutorial : Image Upload (MySQL) Part 2”
Thank you for you teach
thanks 🙂
you are the great sir. thanks alot for such free help to peoples like me
thanks a lot …perfect
TO EVERYONE WHO WANTS TO SAVE IN DATABASE: JUST INSERT THE PATH OF THE PHOTO IN THE DATABASE, ECHO IT BACK OUT IN A IMG TAG WITH THE SOURCE EQUALING THE DATABASE ROW
Great stuff – thanks!
thx a lot 🙂
excellent explaining…. can u put the video for retriving that uploaded file?? plzzz
Great! It works! 🙂
But I am not contented. How can I store image in phpmyadmin!
can I have the the files you made ,please?
thanx bro…
This does say MySQL, no MySQL used at all!
You sir are a GENIUS! The tutorial was easy to follow and worked great
finfo is the way to go.
Help! how do you add text along with an image ( and the image file path) to the database from same form?
WOW!!! that's so informative… to those who expects mySQL, its actually a tutorial on how to save image to your server. the thing here is that you submitted it online, all you have to do is to add your query on the execution, example: save the image name on a column in your database.. so in summary, u did not saved it in database, u just use it's name to call it… Take note to use the function strtolower() on php to avoid data error… thank you anyway…
Thanks for that 🙂
good
Thanks for the tutorial! Very Helpful!
nice tutorial my friend…. thank you for this..
Excuse me, when implemented into a website to be like what? do we have to have its own server?
thank you before
thanks!
great stuff – thanks!
…then store the real name for when the file is to be downloaded (for reference).
This is a very very good tutorial and is pretty much all is needed to get going at least. Yes it lacked the final final part for MySQL but if you know how to add data to MySQL then you'll be sorted with this tutorial.
As for the uploaded folders, you will need to create that on the server yourself and reference it in your code. Check the part in the video where it says "move_uploaded_file". "uploaded/" is it.
If it's just a few files in MySQL then that's fine to add to MySQL but in all honesty I'd only store the file information in the database. In order to do that the variables already stored at the start of this video is all that's needed.
The part where the file is uploaded, you take the $name, $size, or other info you need and INSERT it into your database at the same time.
Personally I'd hash the temp filenames for security reasons and use that as the actual uploaded filename…
how about the MYSQL, storing images in phpmyadmin, how is it?
why it say my sql if you dont use it
@Frostedcreek D'nt be confused my friend, R u understand?
Where is the uploaded folder going to be is it a directory on my ftp?
what is the temporary directory called? On fillazilla my temporary directory is a folder called uploads.. Just a little confused