SŽébastien Cramatte wrote:
'A table must have a primary key, but none was found'

When I  query a  table it's works perfectly  ...
The problem occurs only when I query  a Mysql "view"

A workaround is to set   the protected variable $_primary  to some
column but this not very clean ...
So my question how can I bypass primary keys check when I query views ?

MySQL views don't report their primary key. There is no way Zend_Db_Table can discover this information automatically, as it does with concrete tables.

Declaring the $_primary class variable is the intended usage of Zend_Db_Table. It solves the problem with a single declaration, so you don't have to write any code.

Regards,
Bill Karwin

Reply via email to