CodeIgniter Forums
mySQL problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: mySQL problem (/showthread.php?tid=56034)



mySQL problem - El Forum - 11-22-2012

[eluser]JunlieF[/eluser]
Pls. correct me I need a little help here...


$sql = "SELECT * FROM deparments, prints WHERE 'id{$dept}' AND 'date_printed BETWEEN '{$from}' AND '{$to}'";


mySQL problem - El Forum - 11-22-2012

[eluser]solid9[/eluser]
Why are you using the traditional way?
Why not use Active Records?

Try executing and testing that inside PHPMyAdmin,
So when you see an error it's easy for you to fix it.


mySQL problem - El Forum - 11-23-2012

[eluser]rochellecanale[/eluser]
What exactly you want to do? And what's the error?


mySQL problem - El Forum - 11-23-2012

[eluser]fasfad[/eluser]
If you run that query with $this->db->query($sql);

Use $this->db->last_query(); To get the generated sql and check that or put it in phpmyadmin to check whats wrong with it.