I have a cell in my database which timestamps a task once complete, for reporting I am wanting to show the figure of row which result in the current month.
So for example there may be 10 tasks complete this month but I need to show that figure, I am trying to do this with the following but not even getting any output from it?
$sql="SELECT published FROM to_do_list WHERE MONTH(date)=MONTH(NOW())";
$result = mysqli_query($db, $sql);
if ($result=mysqli_query($db,$sql))
{
// Return the number of rows in result set
$rowcount=mysqli_num_rows($result);
printf("Result set has %d rows.
",$rowcount);
// Free result set
mysqli_free_result($result);
}
So there is a cell called published
which is a DATETIME. the aim is to count and show how many rows contain the current month from that.