Read the contents of the file,
$img=file("filenam.gif");
insert $file into table.
( This is just off the top of my head, you may have to do somehting different , like binary read, or open a socket )
I know you have to open a socket and read() it if the image is on a remote server.