This is my Categories Table:
id | name
1 a
2 b
3 c
4 d
In which I need to get the values of 1 and 2 in comma separated manner, i.e. a,b.
I tried something like this:
$ids = array('0'=>1,'1'=>2);
\DB::select('SELECT group_concat(name) as name from category where id = ?', ($ids));
But it always returns the first value (i.e., a)
I need the resultant values to be like this: a,b.
How could I do this either using normal query or by Laravel?
Thank you.