Having a hard time here trying to retrieve specific records where I need the ID and the Date to match, here is my code:
$testq= DB::table('attendances')->where('user_id', '=', $userinput && 'logon', '=', $newdate)->get();
Just add one more where.
$testq= DB::table('attendances')
->where('user_id', '=', $userinput)
->where('logon', '=', $newdate)
->get();
http://laravel.com/api/4.2/Illuminate/Database/Eloquent/Builder.html#method_where
$this where(string $column, string $operator = null, mixed $value = null, string $boolean = 'and')
Add a basic where clause to the query.
As an addition to @sectus's answer, you might like this syntax:
$testq= DB::table('attendances')->whereUserId($userinput)
->whereLogon($newdate)
->get();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With