jeudi 19 décembre 2019

Laravel Like in Query Builder

I have a problem here, I did a search with the query builder, the database status column is varchar, which is active, inactive, disable

the problem here, if I look for an active status then inactive also appears

 $vendor  = DB::table('client_vendor as cv')
                        ->leftJoin('vendors as fv','fv.id','=','cv.vendor_id')
                        ->select('cv.*','fv.*','cv.status')
                        ->where('cv.status', 'LIKE', '%' . 'active' . '%')
                        ->get();

here I may not change the data type in the database



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire