|
发表于 2008-5-5 00:33:09
|
显示全部楼层
$this->db->trans_start();
$this->db->query("insert into `e_admin`(AdminName) values('aaa')");
$insert_id1 = $this->db->affected_row();
if ($insert_id1<=0)
{
$this->db->trans_rollback();
show_error('插入数据库失败');
}
$this->db->query("insert into `e_admin`(AdminNam) values('')");
$insert_id2= $this->db->affected_row();
if ($insert_id2<=0)
{
$this->db->trans_rollback();
show_error('插入数据库失败');
}
$this->db->trans_commit(); |
|