2008年11月10日星期一

Re: [fw-db] Zend Db Manual Query Problems

If they only request on the same table, we let us not have a message
here ;-) . It isn't the first time that this question is put.

See
http://framework.zend.com/manual/en/zend.db.table.html#zend.db.table.fetch-all,
for more informations on Zend_Db_Table_Select and setIntegrityCheck.

Mickael.

till a écrit :
> On Mon, Nov 10, 2008 at 10:21 AM, mikaelkael <perraud.mickael@orange.fr> wrote:
>
>> Hi,
>>
>> I don't know exactly your problem with raw query. But with instance of
>> Zend_Db_Table_Abstract, most of time, people forget to explicitly declare
>> the from() part.
>>
>> Example:
>> $table = new Members();
>> $select = $table->select();
>> $select->from($this);
>> $select->join('groups', 'members.group_id=groups.id', 'groups.name');
>> $rows = $table->fetchAll($select);||
>>
>
> You don't need to do ->from() in this case unless you need to query a
> different table, etc.. and then it's (IMHO) cleaner to do $db =
> $this->getAdapter(); $db->select()->etc()->pp().. If you stay on the
> same table the from() is implied.
>
> Till

没有评论: