I want to fetch data according to month. Date is stored in timestamp.
select pdate,COUNT(*) from qchat_sessions WHERE month(pdate)='09'
i am using this query but thats not working correctly.
and how to echo the date from time stamp
Thanks
EDIT1
Mainly what i want to do is to echo the dates from that month with no of rows.
in db i have two dates : 2013-09-27
and 2013-09-28
but using:
`$sss=mysql_query("SELECT DATE(pdate),COUNT(*) FROM qchat_sessions WHERE MONTH(pdate)='09'"); $rows = mysql_fetch_array($sss); $a = array($rows[0],$rows[1]);
foreach ($a as $b)
{
print $b . " ";
It echos only 1 date may be i am missing something. } `