Welcome Guest, Not a member yet? Register   Sign In
how to generate queries based on date
#5

[eluser]tusukgigi[/eluser]
SELECT dateflag, COUNT(*) AS num_stats
FROM stat
WHERE MONTH(dateflag)=MONTH(NOW()) AND YEAR(dateflag)=YEAR(NOW())
GROUP BY dateflag

IT'S OK...........................

but,how do I enter the code in my controller:


foreach ($query->result() as $row){
$dataStat[] = intval(num_stats);
}

i got error in my openflashchart

if debug in phpmyadmin its ok
and produce like this:

dateflag num_stats
2010-07-22 2
2010-07-23 4
2010-07-24 1
2010-07-25 6
2010-07-26 2
2010-07-27 6
2010-07-28 3
2010-07-29 415
2010-07-30 361


Messages In This Thread
how to generate queries based on date - by El Forum - 07-30-2010, 01:52 AM
how to generate queries based on date - by El Forum - 07-30-2010, 02:22 AM
how to generate queries based on date - by El Forum - 07-30-2010, 05:02 AM
how to generate queries based on date - by El Forum - 07-30-2010, 05:06 AM
how to generate queries based on date - by El Forum - 07-30-2010, 05:27 AM
how to generate queries based on date - by El Forum - 08-02-2010, 01:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB