开发者

Inserting in a table without primary key using Zend

开发者 https://www.devze.com 2023-02-08 18:05 出处:网络
I can\'t find how to insert 开发者_高级运维a row that doesn\'t have a PK. This isn\'t possible with a class that is extending Zend_Db_Table_Abstract, so how should I do this?

I can't find how to insert 开发者_高级运维a row that doesn't have a PK. This isn't possible with a class that is extending Zend_Db_Table_Abstract, so how should I do this?

The table I in which I want to insert records is a join table. The only two columns in it could serve as a PK, but I don't know how I should let Zend know that neither.

Any suggestions?


Zend doesn't really care if the table have in fact a PK (or an index) or not. The primary_key option in a Zend_Db_Table_Abstract is really just to know which column the 'WHERE' clause will search for when using find and find* methods, etc. So, basically, just specify which columns to use as reference columns for your db model. I can't give you more details since I don't know the details of the said table.

0

精彩评论

暂无评论...
验证码 换一张
取 消