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

      2. <small id='OBopU'></small><noframes id='OBopU'>

        <tfoot id='OBopU'></tfoot>

        MySQL 时间戳 - 为什么全为零?

        MySQL Timestamp - why all zeros?(MySQL 时间戳 - 为什么全为零?)
        <legend id='sayH5'><style id='sayH5'><dir id='sayH5'><q id='sayH5'></q></dir></style></legend>

          <tfoot id='sayH5'></tfoot>

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

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

                    <tbody id='sayH5'></tbody>
                  本文介绍了MySQL 时间戳 - 为什么全为零?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用 PHPMyAdmin,并且有一个名为时间戳"的 MySQL 表列.类型(惊喜!)是 TIMESTAMP,在属性"中我将它设置为 ON UPDATE CURRENT_TIMESTAMP.

                  I'm using PHPMyAdmin and I've got a MySQL table column called "timestamp." The type (surprise!) is TIMESTAMP, and in 'attributes' I've set it to ON UPDATE CURRENT_TIMESTAMP.

                  然而,每条新记录都有一个类似这样的时间戳:

                  However, each new record gets a timestamp that looks like this:

                  0000-00-00 00:00:00
                  

                  我已经明确地将默认值设置为无,但是当我保存并返回查看时,它被设置为如上所示的全零.

                  I have explicitly set the default value to none, but when I save and come back to look, it is set to all zeros as above.

                  相关的 PHP 记录页面点击了这个查询:

                  The relevant PHP records page hits with this query:

                  $query = "INSERT INTO `pagehit` (user_id, pageurl)
                  VALUES ('" . $userid . "', '" . $pageurl . "')";
                  

                  整个过程都在 XAMPP 下运行.

                  The whole thing is running under XAMPP.

                  我错过了什么?

                  推荐答案

                  我错过了什么?

                  你不更新:)

                  使用 DEFAULT CURRENT_TIMESTAMPON UPDATE CURRENT_TIMESTAMP

                  这篇关于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() 文件不起作用?)
                • <legend id='1Nv5x'><style id='1Nv5x'><dir id='1Nv5x'><q id='1Nv5x'></q></dir></style></legend>
                • <small id='1Nv5x'></small><noframes id='1Nv5x'>

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

                              <tbody id='1Nv5x'></tbody>