i got a problem in my project i am using Laravel 4.2
.
Piece of code which have problem..
$xx = xx::where('user_id','=',$user_id)
->where('date','>=',$first_day) //$first_day is first day of any month
->where('date','<=',$last_day)//$last_day is last day of same month
->get();
print_r($xx);die();
//records present but empty array for current month but working fine for any previous month
Result
Illuminate\Database\Eloquent\Collection Object ( [items:protected] => Array ( ) )
Laravel last query log
Array ( [query] => select * from
x_xx
whereuser_id
= ? anddate
= ? anddate
<= ? [bindings] => Array ( [0] => 17 [1] => 2016-04-1 [2] => 2016-04-30 ) [time] => 0.69 )
Running in mysql phpmyadmin i got 15 records
select * from
x_xx
whereuser_id
= 17 anddate
>= '2016-04-1' anddate
<= '2016-04-30' //15 total records found in mysql