Binary data not stored properly in MySQL

亡梦爱人 提交于 2019-12-02 14:23:35

You are using prepared statements incorrectly:

$sql_insert_data->bind_param('s', $mysqli->real_escape_string($encrypted));
                                           ^^^^^^^^^^^^^^^^^^ :-!

Your code will add random backslashes to the binary stream. You don't need real_escape_string() at all.

Rick James

"damn son, the question is how to I optimize the storage of base64_encoded data successfully in mysql. That's all." -- See https://stackoverflow.com/a/42080296/1766831

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!