kaiki
V2EX  ›  问与答

求助 PHP bind_param 一个值为 0 的时候正常,为其他值则 execute 返回 false,无法写入数据库

  •  
  •   kaiki · Jun 19, 2020 · 911 views
    This topic created in 2154 days ago, the information mentioned may be changed or developed.
    这个值 bind 的也是 integer,即使在 bind 之前转 int 也不行,唯有给这个值=0 才能正常提交入库,是什么问题?
    昨天晚上机房更新,邮件里面这么说的:
    由于 PHP 5 生命周期早已结束,继续使用存在安全风险。我们已经提供了很长时间的 PHP 7 版本测试,本次迁移后将会停止 PHP 5 版本服务,只提供 PHP 7.4 版本。MySQL 也会升级至 5.7 版本。

    然后就出问题了。
    1 replies    2020-06-19 14:30:04 +08:00
    kaiki
        1
    kaiki  
    OP
       Jun 19, 2020
    发现问题了,不为 0 的时候要设置日期
    $time = '0000-00-00 00:00:00';
    会导致无法写入。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3218 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 14:36 · PVG 22:36 · LAX 07:36 · JFK 10:36
    ♥ Do have faith in what you're doing.