现在正在做一个系统,需要在增加一条记录时,自动生成每条记录的唯一id号。数据库是mysql,开发工具是Wamp.下面是我增加一条记录的主要代码:
if($action=='add'){
$mysql="insert into a(name,sex,age)
values( '$name','$sex','$age')";
$query=mysql_query($mysql,$lnk);
if($query)echo "添加成功!";
}
如果知道的话,麻烦把详细的代码晒晒!
谢谢了先!
if($action=='add'){
$mysql="insert into a(name,sex,age)
values( '$name','$sex','$age')";
$query=mysql_query($mysql,$lnk);
if($query)echo "添加成功!";
}
如果知道的话,麻烦把详细的代码晒晒!
谢谢了先!
id int(6) not null auto_increment primary key,
alter table a
add column id bigint primykey(id) auto_increment
values(uuid(),'$name','$sex','$age')";