I am sending an array to my API made in Laravel 5, which is an array of valid ex values: [1,3,5]
I am trying to make a selection as follows:
$json = (object)Input::all(); $loans = DB::table("loans") ->where("years", ">=", $json->year_low) ->where("years", "<=", $json->year_high) ->where("risk", $json->risks) ->get();
risks is an array.
What I get from the database, and an empty array.
In the test, I send all possible values 0 ... 4, but I get an empty array.
How to select a row whose column value exists in an array?
source share