Search code examples
zend-frameworkmany-to-manyzend-formzend-db-table

Insert data with Zend_Form and Zend_Db_Table with relationship type 'many-to-many'


I have a form generated by Zend_Form. How do I include the data in the database by Zend_Db_Table in table with relationship type many-to-many?

Please see the code: http://pastebin.com/u3C6TQKi and image example:

enter image description here


Solution

  • First you should insert parent table. You can get insert row id. So insert child data with parent row id. It is best way. Also you can write single query and run it single time.