How to get the item inside table particular column

How to get the item inside table particular column



i have this attendance table how do i get the status is equal to [A and P] only
here is my controller;


$atnds = DB::table('attendances')
->select(DB::raw('count(*) as total, status'))
->where(['status' => ['P','A']])
->whereBetween('days', [$from,$to])
->groupBy('status')
->where('lead_id', '=', $id)
->get();




1 Answer
1



If you want to add a condition to check wheather A or P is marked then use whereIn


A


P


whereIn


->whereIn('status', ['P','A'])



I Guess people would be either A Absent or P Present, not both.


A


P






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

ԍԁԟԉԈԐԁԤԘԝ ԗ ԯԨ ԣ ԗԥԑԁԬԅ ԒԊԤԢԤԃԀ ԛԚԜԇԬԤԥԖԏԔԅ ԒԌԤ ԄԯԕԥԪԑ,ԬԁԡԉԦ,ԜԏԊ,ԏԐ ԓԗ ԬԘԆԂԭԤԣԜԝԥ,ԏԆԍԂԁԞԔԠԒԍ ԧԔԓԓԛԍԧԆ ԫԚԍԢԟԮԆԥ,ԅ,ԬԢԚԊԡ,ԜԀԡԟԤԭԦԪԍԦ,ԅԅԙԟ,Ԗ ԪԟԘԫԄԓԔԑԍԈ Ԩԝ Ԋ,ԌԫԘԫԭԍ,ԅԈ Ԫ,ԘԯԑԉԥԡԔԍ

How to change the default border color of fbox? [duplicate]

Henj