2010-06-30 64 views

回答

5

$this->db->insert_id()可能是你在找什么。下面是它如何工作的一个例子:

$this->db->insert('Table1',$values);  
$table1_id=$this->db->insert_id(); 
$otherValues=array(
    'table1_id'=>$table1_id, 
    ); 
$this->db->insert('otherTable',$otherValues); 
1

尝试使用mysql_insert_id();