I use Laravel DB::select to return specific data from DB,
the problem is only one row return when use print_r($result)
$questions = DB::select('
select text
from question
where id in (?)
order by field(id,?)',
array($question_ids_list_str,$question_ids_list_str));
print_r($questions);
how to return the rest of results? thanks,
rest of resultsapparently. This method returns array of stdObjects representing each row. Btw why do you use this instead of query builder, that's easier to use?$question_ids_list_strcontains. If it contains only one id or one existing id in database, select won't return more rowsDB::table('question')->whereIn('id', $ids)->orderBy(DB::raw('field(id,'.implode(',',$ids).')'))->get();