mercredi 17 juillet 2019

Query gives empty result if I check whether the date 2019-01-12 falls with in a December to January date range

I'm creating an basic Zodiac signs app and I got stuck at this issue. Basically, I just want to check if today falls between a particular date range in the mysql table.

This is my table: Zodia Signs Table

 $date = "2019-03-09"
    $zodiacSign =   DB::table('zodiac_signs')
        ->where(function ($query) use($date){
            $query->where('from_date', '<=', $date)
                  ->where('to_date', '>=', $date);
        })->get();

Every date except the date between 2019-12-22 and 2019-01-19 is working as expected. What am I doing wrong here?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire