There is an array of dates of this type:
Array ( [0] => 2016-08-08 [1] => 2016-08-15 [2] => 2016-08-15 [3] => 2016-08-22 [4] => 2016-08-22 [5] => 2016-08-29 [6] => 2016-08-29 [7] => 2016-09-05 [8] => 2016-09-05 [9] => 2016-09-12 [10] => 2016-09-12 [11] => 2016-09-19 [12] => 2016-09-19 [13] => 2016-09-26 [14] => 2016-09-26 [15] => 2016-10-03 [16] => 2016-10-03 [17] => 2016-10-10 [18] => 2016-10-10 [19] => 2016-10-17 [20] => 2016-10-17 [21] => 2016-10-24 [22] => 2016-10-24 [23] => 2016-10-31 [24] => 2016-10-31 [25] => 2016-11-07 [26] => 2016-11-07 [27] => 2016-11-14) There is a request of this type:
SELECT * FROM tables WHERE filter1 AND filter2 BETWEEN '{$date_s}' AND '{$date_do}' while($row = mysql_fetch_array($res)) { <?=echo 'Всего: '.$row['txt_tip']?> } How to make it so that the dates are substituted in pairs in the request, and the number of records is displayed according to the runs. Those. the first date from the array is the beginning, the second is the end, the third is the beginning, the fourth is the end, etc.
As a result, we should get something like everything: 1, total: 15, total: ... I tried to deduce through for , but somehow it turned out to be very cumbersome and did not work quite correctly.