<?php
$input='1 7 22 45';
$tmp_tb='( select '.str_replace( ' ', ' as id union all select ', $input).' ) as tmp ';
$sql='select y.id, y.search_field from ' . $tmp_tb .
" left join yourtable y on concat( ',', y.search_field , ',' ) like concat( '%,', tmp.id , ',%') ".
" where tmp.id is not null group by y.id ";
echo $sql;
?>