displaying values from join query array
Posted
by THOmas
on Stack Overflow
See other posts from Stack Overflow
or by THOmas
Published on 2010-03-18T09:59:32Z
Indexed on
2010/03/18
10:01 UTC
Read the original article
Hit count: 256
I have used a join query for retrieving value from two tables one is blogquestion and userdetails I wrote this query
$this->questions = Doctrine_Query::create()
->select('b.question_id,b.user_id,b.question_title,b.question_tags,b.created_at,u.id,u.name')
->from('BlogQuestion b')
->leftJoin('b.UserDetails u')
->execute();
In the template iam displaying the result using a foreach
<?php foreach($questions as $quest):?>
echo $quest->getQuestionTitle()
echo $quest->getQuestionTags()
echo $quest->getName()
<?php endforeach?>
title is getting from the blogquestion table and name is in usredetails table
iam getting the eerror
Unknown record property / related component "name" on "BlogQuestion"
© Stack Overflow or respective owner