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