1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
// Recherche des id des thèmes associés -- Le tableau retourné est OK
$tab_th_associe = $this->searchCarteByThemeAssocie($id);
$tailletableau = sizeof($tab_th_associe);
if (Zend_Registry::get('session')->theme && $id == 0)
$id = Zend_Registry::get('session')->theme;
$datas_sql = array();
for($i=0; $i<$tailletableau; $i++){
$select = $this->_db->select()->from(array('ct' => 'Carte_Theme'), array('CT_CARTE'));
$select->join(array('c' => 'Carte'), "c.CA_COMPTEUR=ct.CT_CARTE", array('CA_COMPTEUR'));
if ($pays != NULL) {
$select->where("c.CA_PAYS=?", $pays);
}
if ($departement != NULL) {
$select->where("c.CA_DEPARTEMENT=?", $departement);
}
// Where en fonction de l id du théme
$select->where("ct.CT_THEME=?",$tab_th_associe[$i] );
$select->order('CA_ORDRE_FORMAT');
// Concaténation qui pose problème !!!
$datas_sql .= $this->_db->fetchAll($select);
}//END FOREACH |
Partager