• <small id='p7rid'></small><noframes id='p7rid'>

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

    1. <tfoot id='p7rid'></tfoot>

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

        PHP-MySQL-如何安全地增加 MySQL 整数字段?

        PHP-MySQL-How to safely increment MySQL integer field?(PHP-MySQL-如何安全地增加 MySQL 整数字段?)
      1. <small id='4TXKb'></small><noframes id='4TXKb'>

        <legend id='4TXKb'><style id='4TXKb'><dir id='4TXKb'><q id='4TXKb'></q></dir></style></legend>

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

                  <tbody id='4TXKb'></tbody>
                  <bdo id='4TXKb'></bdo><ul id='4TXKb'></ul>
                  本文介绍了PHP-MySQL-如何安全地增加 MySQL 整数字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想使用 php 和 mysql 安全地增加一个字段值.

                  I want to increment a field value safely using php and mysql.

                  1. 我必须使用什么类型的表/字段?

                  1. What type of table/field must I use?

                  是否有我必须使用的最低 MySQL 版本?

                  Is there a minimum version of MySQL I must use?

                  MySQL 安全事务的 sql 代码是什么?

                  What's the sql code for this, safe transaction for MySQL?

                  推荐答案

                  我假设您指的是存储引擎的表"类型.任何支持突变的东西(即不是存档"或黑洞")

                  By what type of "table" I assume you mean storage engine. Anything that supports mutations (i.e. not "archive" or "black hole")

                  任何数字字段都可以(tinyint、int、float 等).也就是说,没有特殊的 PHP 代码,只有用于增加所需字段的 SQL:

                  Any numeric field will do (tinyint, int, float, etc). That said, there's no special PHP code, just the SQL for incrementing the desired field:

                  UPDATE table SET field = field + 1 WHERE [...]
                  

                  如果你想要一个事务,那就把上面的查询打包成一个事务.至于 MySQL 版本,我同意 @hsz - 尽可能使用最新版本.

                  If you want a transaction, then pack the above query into a transaction. As for MySQL version, I agree with @hsz - use the most current version possible.

                  这篇关于PHP-MySQL-如何安全地增加 MySQL 整数字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Appending GET parameters to URL from lt;formgt; action(将 GET 参数附加到来自 lt;formgt; 的 URL行动)
                  Forcing quot;Save Asquot; dialog via jQuery GET(强制“另存为通过 jQuery GET 对话框)
                  PHP - get certain word from string(PHP - 从字符串中获取某个单词)
                  How to debug a get request in php using curl(如何使用 curl 在 php 中调试 get 请求)
                  get a # from a url in php(从 php 中的 url 获取 #)
                  PHP - include() file not working when variables are put in url?(PHP - 将变量放入 url 时,include() 文件不起作用?)
                  <i id='FlWGQ'><tr id='FlWGQ'><dt id='FlWGQ'><q id='FlWGQ'><span id='FlWGQ'><b id='FlWGQ'><form id='FlWGQ'><ins id='FlWGQ'></ins><ul id='FlWGQ'></ul><sub id='FlWGQ'></sub></form><legend id='FlWGQ'></legend><bdo id='FlWGQ'><pre id='FlWGQ'><center id='FlWGQ'></center></pre></bdo></b><th id='FlWGQ'></th></span></q></dt></tr></i><div id='FlWGQ'><tfoot id='FlWGQ'></tfoot><dl id='FlWGQ'><fieldset id='FlWGQ'></fieldset></dl></div>
                • <legend id='FlWGQ'><style id='FlWGQ'><dir id='FlWGQ'><q id='FlWGQ'></q></dir></style></legend>

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

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

                            <tbody id='FlWGQ'></tbody>
                          <tfoot id='FlWGQ'></tfoot>