select distinct `q`.`id`, `q`.`title`, `q`.`level`, `q`.`question` from `allocatecodings` as `a` inner join `codings` as `q` on FIND_IN_SET(q.id, REPLACE(a.questionid, ' ', '')) > 0 where `a`.`cname` = ? and `a`.`dept` = ? and `a`.`batch` = ? and `a`.`coursename` = ? and `a`.`module` = ? and `a`.`topic` = ? order by `q`.`id` desc Array ( [0] => 1 [1] => 1 [2] => 1 [3] => 1 [4] => 1 [5] => 1 )