Jump to content

[SOLVED] writing temporary image to database not working


shadiadiph

Recommended Posts

any ideas as to why this isn't working?

 


imagecopyresampled($tmp, $src, 0, 0, 0, 0, $widthr, $heightr, $width_orig, $height_orig); 


imagejpeg($tmp, "test.jpg", 100);  //imagejpeg($resampled, $fileName, $quality);            
                                         $instr = fopen("test.jpg","rb");                                           
$image = addslashes(fread($instr,filesize("test.jpg")));                        
                                         mysql_query("UPDATE `upload` SET `thumbnail`= ( \"".$image."\") WHERE `intProductID`= '$adid' ");

mm i just changed addslashes to mysql_real_escape_string()  and immediately started getting the error message

 

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/hmtcompa/public_html/user/submitad.php on line 118

 

Parse error: syntax error, unexpected T_STRING in /home/hmtcompa/public_html/user/submitad.php on line 118

 

with addslashes there were no error messages it just wasn't writing to the database. I have the column thumbnail set as a longblob that is correct right?

 

mm quite embarassing actually lol i have been awake for 20 hours+ doing this today mm the problem was the name of the column i was calling setting the data to it was called uploads not upload it actually works fine as it was. I figured this out when i tried to just set it as something simple and it didnt work.

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.