It is given. There is an info_yarluk table and it has a column for which we make selections - info_date_start (date format).
Task. Make a count of the number of records for the month and group weekly.
Came to this request:
$ info_year = date ('Y');
$ info_month = date ('n');$ sql = "SELECT info_date_start, count (info_date_start), WEEK (info_date_start) FROM info_yarluk WHERE MONTH (info_date_start) = $ info_month AND YEAR (info_date_start) = $ info_year GROUP BY WEEK (info_date_start_Estar_k)
Produces an array:
array(5) { [1]=> int(0) [2]=> string(10) "2016-04-22" [3]=> string(10) "2016-04-01" [4]=> int(0) [8]=> string(10) "2016-04-12" } How to make a request?