Hi everybody,
What is the problem in this query
i dump the variable outside the foreach function
array is empty.
but inside foreach some resords are comming.
anybody plz help .
$db = Doctrine_Manager::getInstance()->getCurrentConnection();
$count = 0 ;
$sql = " SELECT *
FROM album a,meetnewpeople m
WHERE
a.personal_id = ".$this->personal->getId()."
AND a.type ='plan' " ;
$query = $db->prepare($sql);
$query->execute();
$plans = $query->fetchAll();
//$planalbum[] = array();
$this->planalbum = new ArrayObject();
foreach($plans as $plan)
{
$sql = " Select * from picture p
where
p.personal_id = :personal_id
and p.description = 'main picture'
and p.album_id = ".$plan["album_id"];
$query = $db->prepare($sql);
$query->execute(array('personal_id' =>
$this->personal->getId()));
$result = $query->fetchAll(PDO::FETCH_ASSOC);
var_dump($result);
$this->planalbum->append($result);
}
//print_r();
var_dump($this->planalbum);