class A{
public function insertA(){
//插入A表的代码
[color=#FF0000]$this->insertB($a_id)[/color];
}
public function insertB($a_id){
//插入B表的代码
}
}
------解决方案-------------------- 用mysql 触发器 http://blog.csdn.net/mengxiangbaidu/article/details/7345108
------解决方案--------------------
------解决方案--------------------
mysql_query("insert into jf(id,name) values(null,'$name')",$conn) or die(mysql_error()); if($f){ $jf_id = mysql_insert_id(); mysql_query("INSERT INTO user (id,jf_id) VALUES (null,'$jf_id')",$conn) or die(mysql_error()); }