i'm trying to use a variable that i get it from an html form here is the html code
<input type="date" name="begin_date">
<input type="date" name="end_date">
and i will enter something like this 2015-6-20 00:00:00 in the text fields. then i want to use those variables in mysql where clause like below:
->where('o.invoice_date >= $begin_date AND o.invoice_date < $end_date');
but somehow it doesn't work...
when i do it like
->where('o.invoice_date >= "2015-6-20 00:00:00" AND o.invoice_date < "2015-6-20 00:00:00"');
it works fine but not with variables.. what's the problem?