How to change Zend_Db_Table name within a Model to insert in multiple tables

前端 未结 3 1132
余生分开走
余生分开走 2021-01-03 09:37

Using Zend Framework, I\'ve created a Model to insert a record into a database. My question is, after $this->insert($data) how can I switch the active table

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-03 10:18

    Also you can use the class Zend_Db_Table. Something like this:

     $fooTbl = new Zend_Db_Table('foo');
     $lastFooID = $fooTbl->insert($data2)
                         ->getAdapter()
                         ->lastInsertId();
    

提交回复
热议问题