<legend id='pc8Tl'><style id='pc8Tl'><dir id='pc8Tl'><q id='pc8Tl'></q></dir></style></legend>

<small id='pc8Tl'></small><noframes id='pc8Tl'>

        • <bdo id='pc8Tl'></bdo><ul id='pc8Tl'></ul>

        <i id='pc8Tl'><tr id='pc8Tl'><dt id='pc8Tl'><q id='pc8Tl'><span id='pc8Tl'><b id='pc8Tl'><form id='pc8Tl'><ins id='pc8Tl'></ins><ul id='pc8Tl'></ul><sub id='pc8Tl'></sub></form><legend id='pc8Tl'></legend><bdo id='pc8Tl'><pre id='pc8Tl'><center id='pc8Tl'></center></pre></bdo></b><th id='pc8Tl'></th></span></q></dt></tr></i><div id='pc8Tl'><tfoot id='pc8Tl'></tfoot><dl id='pc8Tl'><fieldset id='pc8Tl'></fieldset></dl></div>
      1. <tfoot id='pc8Tl'></tfoot>

        MySql将二进制数据插入db而不会出错

        时间:2023-10-30

        <small id='THFre'></small><noframes id='THFre'>

            <bdo id='THFre'></bdo><ul id='THFre'></ul>

            • <legend id='THFre'><style id='THFre'><dir id='THFre'><q id='THFre'></q></dir></style></legend>
              • <tfoot id='THFre'></tfoot>
                  <tbody id='THFre'></tbody>
                  <i id='THFre'><tr id='THFre'><dt id='THFre'><q id='THFre'><span id='THFre'><b id='THFre'><form id='THFre'><ins id='THFre'></ins><ul id='THFre'></ul><sub id='THFre'></sub></form><legend id='THFre'></legend><bdo id='THFre'><pre id='THFre'><center id='THFre'></center></pre></bdo></b><th id='THFre'></th></span></q></dt></tr></i><div id='THFre'><tfoot id='THFre'></tfoot><dl id='THFre'><fieldset id='THFre'></fieldset></dl></div>

                  本文介绍了MySql将二进制数据插入db而不会出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有问题.当我在 php 中进行这样的插入时:

                  I have a problem. When I do an insert like so in php:

                  sql = "INSERT INTO mytable (id, value)
                  VALUES ('sds83','".$EncryptedString."')";
                  

                  当我运行以下查询时,它有时有效,有时无效.问题是有时 $EncryptedString 包含这样的字符:')')这会导致语法错误.$EncryptedString 包含二进制数据,我该如何解决这个问题?

                  When I run the following query it sometimes works and sometimes it doesn't. The problem is that sometimes the $EncryptedString contains characters like this: ')') which causes syntax errors. The $EncryptedString contains binary data, how can I go about this issue?

                  推荐答案

                  转义你的加密字符串

                  mysql-real-escape-string

                  mysql_real_escape_string() 调用 MySQL 的库函数mysql_real_escape_string,将反斜杠添加到以下内容字符:x00、 、 、、'、" 和 x1a.

                  mysql_real_escape_string() calls MySQL's library function mysql_real_escape_string, which prepends backslashes to the following characters: x00, , , , ', " and x1a.

                  参见 StripSlashes

                  这篇关于MySql将二进制数据插入db而不会出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:将一个表中的值插入到另一个表中 下一篇:当 PHP 变量包含单引号时未插入 MySQL 查询

                  相关文章

                    <bdo id='ZNZri'></bdo><ul id='ZNZri'></ul>
                  <legend id='ZNZri'><style id='ZNZri'><dir id='ZNZri'><q id='ZNZri'></q></dir></style></legend>
                  <tfoot id='ZNZri'></tfoot>

                    1. <i id='ZNZri'><tr id='ZNZri'><dt id='ZNZri'><q id='ZNZri'><span id='ZNZri'><b id='ZNZri'><form id='ZNZri'><ins id='ZNZri'></ins><ul id='ZNZri'></ul><sub id='ZNZri'></sub></form><legend id='ZNZri'></legend><bdo id='ZNZri'><pre id='ZNZri'><center id='ZNZri'></center></pre></bdo></b><th id='ZNZri'></th></span></q></dt></tr></i><div id='ZNZri'><tfoot id='ZNZri'></tfoot><dl id='ZNZri'><fieldset id='ZNZri'></fieldset></dl></div>

                      <small id='ZNZri'></small><noframes id='ZNZri'>