Zend_Db_Select from plusieurs tables
Bonjour à tous,
J'ai un problème pour transcrire une requête SQL en utilisant Zend_Db_Select :
Voici la requête (qui fonctionne) :
Code:
1 2 3 4 5 6 7
|
SELECT *
FROM Repondants,action
WHERE action.id_rep='$idrep'
AND Repondants.IDS=$idsurvey
AND action.id_rep=Repondants.id_rep
AND action.Date_Emission='$date_emission' |
Voici comment je la traduit en utilisant Zend_Db_Select :
Code:
1 2 3 4 5 6 7 8 9 10
|
$filtre2 = "action.id_rep = ". $idrep . " AND repondants.IDS = " . $idsurvey . " AND action.id_rep = repondants.id_rep AND action.Date_Emission = " . $date_emission ;
$select = $db->select()
->from('repondants')
->from('action')
->where($filtre2);
$action_rowset=$db->fetchall($select->query());
$action_rowcount= count($action_rowset); |
Malheureusement, cela ne fonctionne pas, et voici le message d'erreur :
Citation:
Catchable fatal error: Object of class Zend_Db_Statement_Pdo could not be converted to string in C:\Zend\ZendServer\share\ZendFramework\library\Zend\Db\Statement.php on line 204
Je ne trouve rien de concluant sur internet...
Merci d'avance de votre précieuse aide :calim2: