创建全局唯一ID

xiaoxiao2021-02-28  22

//创建全局唯一ID function create_uuid(){ $obj = M(); $sql = "REPLACE INTO ".C('DB_PREFIX')."uuid (`stud`) VALUES ('a')"; $obj->execute($sql); return $obj->getlastInsID();

}

-- 表的结构 `general_uuid` -- CREATE TABLE IF NOT EXISTS `general_uuid` ( `id` int(11) NOT NULL AUTO_INCREMENT, `stud` char(1) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `stud` (`stud`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

转载请注明原文地址: https://www.6miu.com/read-1950299.html

最新回复(0)