Basically this is what you can do. I wouldn't recommend putting the full url into the database. If you happen to change servers then you'll have to make changes to the database. Instead you can just store the photo name "example.jpg" and then add that on to the path in your html.
if (move_uploaded_file($source, $destination)) { // if the file is uploaded successfully
$photo = basename($destination); // get photo name without the full path
connect to database here // self explanatory
select database here // self explanatory
do the query: // insert into tablename values ('id', '$photo');
}
print "<img src=\"http://yourhost.com/images/$photo\" />";