2008年11月10日星期一

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

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);||

Mickael.

||jbennett55 a écrit :
> Hi,
>
> I am getting this error from Zend Framework in my action controller:
> SQLSTATE[42000]: Syntax error or access violation: 1065 Query was empty
>
> There seem to be a number of resources online that point to setting the
> setIntegrityCheck to false on the select object:
> http://www.zfforums.com/zend-framework-components-13/databases-20/problems-join-672.html
>
> However, I am using a manual query and not a select object. Any suggestions?
> $sql = "<complex sql statement>";
> $result = $db->fetchAll($sql);
>
> Thanks.
>

没有评论: