2010-06-30 5 views

Répondre

5

$this->db->insert_id() peut être ce que vous cherchez. Voici un exemple de comment cela pourrait fonctionner:

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

Essayez d'utiliser mysql_insert_id();

Questions connexes