$sql = 'SELECT have_show FROM `date` WHERE DATE(`date`.day) = ?';
$this->db->query($sql, array($date)); //works fine
This works fine as expected.
$sql = 'SELECT actors, visitors, tickets, have_show FROM show
JOIN `date` ON show.day = `date`.id
WHERE DATE(`date`.day) = ?';
$this->db->query($sql, array($date));
here, with joined statements it gives 0 results.
db schema
id(AI) day(INT FK-date.id) actors(INT) visitors(INT)
1 2 3 45
id(AI) day(DATE) have_show(BOOLEAN)
1 2012-12-06 0
2 2012-12-07 1
codeigniter’s active records does the same.
Any of you ever suffered from this kind of poblems?
try this one
you have mixed between
date.dayanddate.id.or maybe u have
show.idnotshow.dayso look what u have in your table and if yesreplace in your sql
show.daybyshow.idEDIT: