元の画像をimgs/フォルダーとサーバーに正常に追加しました。しかし、サムネイルをデータベースに追加したいと思います。imgs /フォルダーに追加しましたが、データベースに挿入する方法が見つからないようです。
これは、imgをトリミングしてフォルダーに挿入するために使用されるコードの最後のビットです。
プロファイルを持っているので、$_SESSIONユーザーとUsersフレンドを呼び出すことができるようにデータベースにも挿入する必要があります。
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);
        $creator_id     =   $_SESSION['id'];
            $sql = "UPDATE users SET user_pic_small='".$img."' WHERE id=$creator_id";
            $sql2 = "INSERT INTO userphotos(photo_ownerid,photo_ispublic, photo_name, photo_caption, photo_imagedata) VALUES ($creator_id,1,'Profile Picture','Profile Picture','$img')";
            // insert the image
            if(!mysql_query($sql)) {
                echo "Fail. It broke.";
            }else{
            $c=mysql_query($sql2);
                echo "<script> parent.alert('Image Uploaded','',1000);</script>";
            }
    }
}
}
誰かが助けてくれることを願っています。ありがとう。