While show data in graph or stats according to month so there we need to get current month records in MySQL and PHP. I am telling you best way to get COUNT records from the database according to month. Follow this code:
Get current month records
mysql_query("SELECT count(*) as total FROM table where YEAR(created_at) = '2017' and MONTH(created_at) = '9' ")
If you really like this post. Please Comment or share with social buttons for others help. You can more read useful articles phpcoder.org.