Hi guys,How can I use a Mysql View as a Table Model in ZF?I'm now receiving this error, which is totally right:A table must have a primary key, but none was foundsince views don't have Pkeys.The only way i can use views now is by doing this:$select = $table->select() ->setIntegrityCheck(false)->from('v_myview')->where('c_username = ?',"$loggedinuser->username");$results = $table->fetchAll($select);I think there should be a way to avoid this long road.and i'm first initiating a 'useless' table since afterwards i'm selecting the from from another 'table(view)',so performance wise this isn't right either.Thanks,Patrick
2008年8月7日星期四
[fw-db] 7A2-99B - Using a Mysql View as a Table
订阅:
博文评论 (Atom)
没有评论:
发表评论