I need to show total count of rows from database ordering by month.
There are my code:
<?php
$sql = "SELECT aptName FROM property WHERE status='Sold' GROUP BY MONTH(createdate)";
if ($result=mysqli_query($con,$sql))
{
$rowcount=mysqli_num_rows($result);
printf("%d\n",$rowcount);
mysqli_free_result($result);
}
?>
I want to show how many properties sold out in current month. Same thing in next month and so on..