youla
V2EX  ›  PHP

PHP PDO lastinsertId 有什么要求?

  •  
  •   youla · Dec 16, 2020 · 1860 views
    This topic created in 1980 days ago, the information mentioned may be changed or developed.

    目前是(MySQL)bigint 的随机 id,insert 成功返回 0,之前用 int 自增 id 正常。

    zarte
        1
    zarte  
       Dec 16, 2020
    百度 MySQL lastinsertId
    youla
        2
    youla  
    OP
       Dec 16, 2020
    @zarte 别傻了,我肯定是百度过才来提问的。
    youla
        3
    youla  
    OP
       Dec 16, 2020
    已百度,已 Bing 、Yandex,跪求大佬指教!
    youla
        5
    youla  
    OP
       Dec 16, 2020
    @dzdh 谢谢,可惜什么也木有看懂~
    youla
        6
    youla  
    OP
       Dec 16, 2020
    @dzdh 是长度原因么
    dzdh
        7
    dzdh  
       Dec 16, 2020
    只返回自增的。如果你不是自增的,那这个值不管用
    youla
        8
    youla  
    OP
       Dec 16, 2020
    @dzdh 噢,谢谢,有点小扎心!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5222 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 07:53 · PVG 15:53 · LAX 00:53 · JFK 03:53
    ♥ Do have faith in what you're doing.