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

      1. <small id='FrYbX'></small><noframes id='FrYbX'>

      2. <tfoot id='FrYbX'></tfoot>
          <bdo id='FrYbX'></bdo><ul id='FrYbX'></ul>

        长整数在插入较短的列时进行转换,而不是截断.为什么?公式是什么?

        Long integer is transformed when inserted in shorter column, not truncated. Why? What is the formula?(长整数在插入较短的列时进行转换,而不是截断.为什么?公式是什么?)
          <tfoot id='87b1Y'></tfoot>

            <tbody id='87b1Y'></tbody>

          <legend id='87b1Y'><style id='87b1Y'><dir id='87b1Y'><q id='87b1Y'></q></dir></style></legend>
              <bdo id='87b1Y'></bdo><ul id='87b1Y'></ul>

                <small id='87b1Y'></small><noframes id='87b1Y'>

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

                  本文介绍了长整数在插入较短的列时进行转换,而不是截断.为什么?公式是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一列 integer 类型的列,长度为 10:

                  I have a column of type integer with length 10:

                  `some_number` int(10) unsigned NOT NULL
                  

                  我在此列中插入了一个太长的数字:

                  Into this column I insert a number that is too long:

                  $some_number = 715988985123857;
                  $query = "INSERT INTO this_table SET some_number = ?";
                  $stmt = $mysqli->prepare($query);
                  $stmt->bind_param('i', $some_number);
                  $stmt->execute();
                  

                  当我查看表格中的内容时,现在的数字是:

                  When I look at what is in the table, the number is now:

                  2147483647

                  715988985123857如何以及为什么变成2147483647?
                  为什么它没有被截断?
                  这种转换背后的机制是什么,可以用一些公式计算得到的数字吗?

                  How and why did 715988985123857turn into 2147483647?
                  Why didn't it get truncated?
                  What is the mechanism behind this transformation, and can the resulting number be calculated with some formula?

                  我不是在寻找解决方案.我只是想了解具体的数字.

                  I'm not looking for a solution. I just want to understand the specific number.

                  推荐答案

                  http://dev.mysql.com/doc/refman/5.0/en/integer-types.html

                  整数溢出会将DB中的最大允许数设置为

                  The integer overflow will set the max allowed number in the DB as

                  2147483647
                  

                  所以你需要 bigint 数据类型来存储更大的整数

                  So you need bigint datatype for storing bigger integer

                  这篇关于长整数在插入较短的列时进行转换,而不是截断.为什么?公式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                  <tfoot id='BDoqe'></tfoot><legend id='BDoqe'><style id='BDoqe'><dir id='BDoqe'><q id='BDoqe'></q></dir></style></legend>

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

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