I have been trying to storing binary datas like images into the MySQL database. The column type is set to LONGBLOB, but I'm unable to successfully store the file. It seems when I execute the query, it will somehow go corrupted. I have tried using mysql_real_escape_string, addslashes to escape and tried bin2hex to store but all failed. Any suggestion?