show count of rows between 2 dates
- by hello
I am trying to show the number of rows that have a created_at date between 2 dates.
Here is my code:
$result=mysql_query("select * from payments where
created_at between '2013/10/01 00:00:00' and '2013/10/30 00:00:00'")
or die('You need to add an administrator ' );
$counter = mysql_query("select * from payments where
created_at between '2013/10/01 00:00:00' and '2013/10/30 00:00:00'");
$row = mysql_fetch_array($result);
$id = $row['id'];
$num = mysql_fetch_array($counter);
$countjan = $num["id"];
However when i echo (<?php echo"$jan";?>)this shows as 0 any idea how i can get this to work
P.s there is 1 row within this date range