I have an array, say $array
, that I'd like to pass into a query executed using the Laravel DB:select
method, eg.:
$results=DB::select("select * from table where id in ?",[$array])
How can I do this? Passing in like the above gives me an Array to string conversion error.
This is MariaDB
I have seen this Laravel 4: DB::select with IN statment, which is not sufficient for my needs ("Use a proper query").