Need a tutorial on storing image paths in mysql using php?


#1

Can anybody point me in the direction of a tutorial for uploading images to a folder and storing their path in MySQL using PHP and then retrieving the stored path and displaying the image in a search page?
I’ve searched this subject for a couple weeks now and EVERY single tutorial and script I have come across is either poorly explained or written with so many errors in them that trying to figure out why they don’t work becomes so frustrating you don’t want to bother with it any more.
I’m not looking for someone to write a complete script for me as I am trying to learn on my own but it seems like people make tutorials and don’t even bother to test it and see if it really works!


#2

No longer needed I figured it out on my own!


#3

A function can also take arguments, the same way as any normal PHP function can. Note however that you cannot redefine a function. Explicit overloading, the way it is done in Java or C++, is not possible in PHP.


#4

Take a look at this tutorial.

Go to line 35 of step 3.
You can put your sql code here to insert the image using the variable $imgname.
You can set the path on line 12.

Hope that helps,
Red :wink:


#5

I’m not looking for someone to write a complete script for me as I am trying to learn on my own but it seems like people make tutorials and don’t even bother to test it and see if it really works!


#6

You telling me my image upload doesn’t work?