Basically you can use one of two methods.
Load the image through an HTML form, then use copy() to put it into a directory. Insert the path to the image into the DB. When you need to display the image, pull the path from the DB and create an <img src="image.jpg"> tag.
Load the binary data directly into the DB. Then pull it out and construct the image from raw data using a header like this ...
header("Content-type: image/pjpeg");
The first method is the preferred way to do it.