Jump to content

[SOLVED] update not working


shadiadiph

Recommended Posts

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

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

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'";

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.