i used for the joinLeftUsing(); function, does this function make calls to
the rules i set for the referenced tables? What i have now is the exact
table name and column name of the table 'venuecategory'.
Bill Karwin wrote:
>
>
> dele454 wrote:
>>
>> $sql = $this->select();
>> ->joinLeftUsing('venuecategory', 'CategoryID');
>>
>
> This is simply a syntax error based on a typo. You have ended a line with
> a semicolon and then expected to continue the expression on the next line
> with `->' object notation.
>
> This is a rudimentary mistake and you should be able to resolve it without
> posting to a mailing list. Are you familiar with reviewing PHP error
> messages in your Apache log file?
>
> Correcting the syntax error, there is still a problem, because
> Zend_Db_Table_Select requires you to specify a from() clause before you
> can join to another table. I don't know why this was designed this way.
>
> You also need to set integrity check to false to permit joins. So your
> function should be as follows:
>
> public function getAllVenues() {
> $sql = $this->select()->setIntegrityCheck(false)
> ->from($this)
> ->joinLeftUsing('venuecategory', 'CategoryID');
> $result = $this->fetchAll($sql)->toArray();
> return $result;
> }
>
> Regards,
> Bill Karwin
>
-----
dee
--
View this message in context: http://www.nabble.com/Using-the-Zend_Db_Table-to-return-referenced-row-values-tp18688983p18704111.html
Sent from the Zend DB mailing list archive at Nabble.com.
没有评论:
发表评论