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?
Well, after inserting the data into the database, when I can retrieve from the database and echo it, it appears corrupted. The png image file is unable to be displayed. I'm wondering if it has to do with encoding or something.