I want to display each Month data. Consider Month starts today 2018-04-11 and ends on 2018-05-11, so the in between whatever products we will be added I want to display them.
Below is my query I am using:
$curYear = date('Y-m', time());
$MonthendDate = '11';
$MonthEnd = $curYear.'-'.$MonthendDate;
$today= date('Y-m-d');
$select_agent = mysqli_query($conn,"SELECT *
FROM disbursal_amt as D
INNER JOIN customer_details as c
WHERE (D.da_cid = c.cid)
AND (D.da_bt_id = '".$_POST["employee_id"]."')
AND (D.da_date BETWEEN '$MonthEnd' AND '$today') ");
But I am getting only current month data with above query.
The products will be added on daily bases and out put should generate of that month only.
Please help me out.