hello i have this MYSQL QUERY
public function getInvoices($data,$date1,$date2)
{
$get = "Select count(*) as count,
str_to_date(concat(yearweek(date),'monday'),'%X%V %W') as date,
DATE_ADD(str_to_date(concat(yearweek(date),'monday'),'%X%V %W'),INTERVAL 6 DAY) as endDate
FROM affilitechargebackResponse
WHERE companyID = ".$data."
AND date >=".$date1."
AND date <=".$date2."
AND process = 1
group by yearweek(date);";
$query = $this->db->query($get);
return $query->result();
}
I dont know what is the reason why nothing will return even i have a data from my database. When i delete the line AND date <=".$date2."
the code will return the data from db..Even i try BETWEEN still it return null