Inserting Thumbnail into Database
===

I have successfully added the original image into my imgs/ folder and also onto the server. But I'm wanting to add the thumbnail into the database. I've added it into the imgs/ folder but can't seem to find away to insert it into the database. 

This is the final bit of code that is used to crop the img and insert it to the folder. 

I need to insert it into the database also so I can call on it for the $_SESSION User and the Users friend as I have profiles. 



      if (isset($_POST["upload_thumbnail"]) && strlen($large_photo_exists)>0) {
        	//Get the new coordinates to crop the image.
        	$x1 = $_POST["x1"];
        	$y1 = $_POST["y1"];
        	$x2 = $_POST["x2"];
        	$y2 = $_POST["y2"];
        	$w = $_POST["w"];
        	$h = $_POST["h"];
        	//Scale the image to the thumb_width set above
        	$scale = $thumb_width/$w;
        	$cropped = resizeThumbnailImage($thumb_image_location, $large_image_location,$w,$h,$x1,$y1,$scale);
        	//Reload the page again to view the thumbnail
        	header("location:".$_SERVER["PHP_SELF"]);
        	exit();
        }
        if(isset($_GET['a'])){
        if ($_GET['a']=="delete"){
        	if (file_exists($large_image_location)) {
        		unlink($large_image_location);
        	}
        	if (file_exists($thumb_image_location)) {
        		unlink($thumb_image_location);
        	}
        }
        }
        ?>
    
Hope someone can help. Thanks.