I just change my check out string
from this
$check_out = date("Y-m-d" strtotime($_POST['co'])
to
$check_out = date("Y-m-d", strtotime('-1 day', strtotime($_POST['co'])));
And remove the DATEDIFF() & ABS()
in the query like this below
SELECT r.*, rr.rid, SUM(rr.rate) as totalsum, rr.sdate, rr.edate
FROM rooms r
LEFT JOIN rates as rr ON r.id=rr.rid
WHERE rr.sdate >= :ci AND rr.edate <= :co
GROUP BY rr.rid, r.room_name
Done.
solved Minus a day in DATEDIFF query