This is my Query . It does not give result.If i place a quote the query runs. How to place that quote.
Select sum(r.views) as sum_views ,r.revenue_date ,
l.lot_id ,l.lot_name,r.type_name
FROM tbl_revenue_upload r , tbl_lot_details as l
WHERE AND l.lot_id ='.$search['lot'].'
And revenue_date >= '.$search['from_date'].'
And revenue_date <= '.$search['to_date'].'
group by r.type_id ,month(revenue_date)