Syntax Question for Counting Results? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Syntax Question for Counting Results? (/showthread.php?tid=14501) |
Syntax Question for Counting Results? - El Forum - 01-05-2009 [eluser]Solarpitch[/eluser] Hi, Just wondering if this Syntax is correct. Its just that if I put this into phpmyadmin I get the correct result of 40 being returned. Code: SELECT count(type) from sales where tpe = 'cash' and date = $yesterday; However when I run it like this from my model, I just get 0. So im just wondering if the sql in the model will produce the above? I'm sure there's a way to print the SQL query to screen from the model? Code: function yesterday_cash_sales() Syntax Question for Counting Results? - El Forum - 01-05-2009 [eluser]Solarpitch[/eluser] Actually.. this seemed to be the answer... Code: function yesterday_cash_sales() Seems I was using the get_where() incorrectly. |