[eluser]Kromack[/eluser]
Version : CI 1.6.1
Hi all,
I have a problem with one query that produce a strange error...
Here is my code :
Code:
public function getListeAbonnes()
{
$sql = "SELECT courriel FROM Prospect WHERE estActif = '1' UNION SELECT courriel FROM ProspectChaudParticulier WHERE estActif='1' AND recevoirInformation = '1' AND recevoirPromotion = '1'";
$this->db->query($sql);
return $this->db->get();
}
And i have this error :
Code:
An Error Was Encountered
Error Number: 1096
No tables used
SELECT *
But I'm a little confused because this query work properly when I run it with phpmyadmin or in CLI.
Does anybody have an idea ?
Is there an active-record way to do UNION query ?
What I'm missing ? ^^