<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 时间戳 - 为什么全为零?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 的问题)
                • <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>