shadiadiph Posted December 31, 2008 Share Posted December 31, 2008 been trying this for hours with different ways can't seem to get it to work it is time consuming uploading pics to find out that it isn't working again any idea? I am trying to update a blob field in my database $data2 $thumbnail2 are already blob files that are stored in the database I have already called them in the header everything else updates in this row except the blobs they just stay at [bLOB 0B]?? I have spent ages going through articles on the net but haven't found an answer for it anywhere $file1 = (fread(fopen($data2,0,"data2"))); $file2 = (fread(fopen($thumbnail2,0,"thumbnail2"))); $sql02 = "update zloads set description1 = '$description2', data1 = '$file1', filename1 = '$filename2', filesize1 = '$filesize2', filetype1 = '$filetype2', thumbnail1 = '$file2', thumbnailtype1= '$thumbnailtype2' where intProductID='$id'"; Link to comment https://forums.phpfreaks.com/topic/138981-solved-update-not-working/ Share on other sites More sharing options...
shadiadiph Posted December 31, 2008 Author Share Posted December 31, 2008 keep getting these errors Warning: fopen(‰PNG ) [function.fopen]: failed to open stream: Success in /home/hmtcompa/public_html/user/myaccount/updatepics.php on line 78 Warning: Wrong parameter count for fread() in /home/hmtcompa/public_html/user/myaccount/updatepics.php on line 78 Warning: fopen(ÿØÿà) [function.fopen]: failed to open stream: Success in /home/hmtcompa/public_html/user/myaccount/updatepics.php on line 79 Warning: Wrong parameter count for fread() in /home/hmtcompa/public_html/user/myaccount/updatepics.php on line 79 $file1 = addslashes(fread(fopen($data2,0,"data2"))); // line 78 $file2 = addslashes(fread(fopen($thumbnail2,0,"thumbnail2"))); //line 79 Link to comment https://forums.phpfreaks.com/topic/138981-solved-update-not-working/#findComment-726854 Share on other sites More sharing options...
shadiadiph Posted December 31, 2008 Author Share Posted December 31, 2008 solved it already with $file1 = $row["data2"]; $file1 = mysql_real_escape_string($file1); $file2 = $row["thumbnail2"]; $file2 = mysql_real_escape_string($file2); $sql02 = "update zloads set description1 = '$description2', data1 = '$file1', filename1 = '$filename2', filesize1 = '$filesize2', filetype1 = '$filetype2', thumbnail1 = '$file2', thumbnailtype1 = '$thumbnailtype2' where intProductID='$id'"; Link to comment https://forums.phpfreaks.com/topic/138981-solved-update-not-working/#findComment-727265 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.