Hi,
I stuck in updating a db which save in mysql . below is the mehtod i upload my image and save in mysql db. and it works.
==========================
$imagehw2 = GetImageSize($form_data2);
// Do this prior to adding slashes
// to the data.
$imagewidth = $imagehw2[0];
$imageheight = $imagehw2[1];
$imagetype = $imagehw2[2];
$size = filesize($form_data2);
if ($size >0 ) {
$form_data2 = addslashes(fread(fopen($form_data2, "r"), filesize($form_data2)));
//insert the thumbnail image to objectbin
$res2 = myquery("insert into objectbin values ('','$size','$imagehw2[0]','$imagehw2[1]','$form_data2_type','$form_data2_name','".$img2['imgdesc']."','".addslashes($form_data2)."','-1','')", 'ecard');
$thumb_id = mysql_insert_id();
==========================
and the script I try to update it is almost the same, juz the update syntax is different. but i found that the << $imagehw3 = GetImageSize($userfile); >> is empty when GetImageSize();
++++++++++++++++++++++++++
if (!empty($userfile)) {
$imagehw3 = GetImageSize($userfile);
// Do this prior to adding slashes
// to the data.
$imagewidth = $imagehw3[0];
$imageheight = $imagehw3[1];
$imagetype = $imagehw3[2];
$size = filesize($userfile);
$type = '';
if ($imagetype == '2') {
$userfile_type = 'image/pjpeg';
}
$userfile = (fread(fopen($userfile, "r"), filesize($userfile)));
echo "UPDATE objectbin SET objsize='".$size."', objwidth='".$imagewidth."', objheight='".$imageheight."', objtype='".$userfile_type."', objname='".$userfile_name."' , objdata='".$form_data3."' WHERE id='".$image_id."';";
$res = myquery("UPDATE objectbin SET objsize='".$size."', objwidth='".$imagewidth."', objheight='".$imageheight."', objtype='".$userfile_type."', objname='".$userfile_name."' , objdata='".addslashes($userfile)."' WHERE id='".$image_id."';", 'ecard');
}
++++++++++++++++++++++++++
Please Help!!!