I think what you are asking for is this: You want the file to be saved in your images directory and you want the name of the file inserted into your data base.
First, assume that your HTML form looks like this:
<form method="POST" action="upload2.php" ENCTYPE="multipart/form-data">
<input TYPE="file" NAME="FILE1"><input type=submit value="Upload"></form>
Then the PHP code should look like this:
<?
// This saves the file on your web server:
@copy("$FILE1" , "/the/path/to/your/web/site/docs/images/$FILE1_name");
// Then connect to your database
mysql_connect("localhost","username","password");
@mysql_select_db("your_database") or die( "Unable to select database");
// Then insert this new filename into your table like this:
$query = "insert into uploaded_images (name) values ('$FILE1_name')";
$result = MYSQL_QUERY($query);
?>
When you read the filename out of the database, it's just going to be "image.jpg" so you're going to have to build the whole URL like this:
<img src="<? print "http://www.site.com/images/$filename"; ?>">