I think you are tryin to select all codes in the array if that is so you can use
$all_code = Array('123',124','341')l
$search_string = "('" . implode("','",$all_code) . "')";
then
select * from data where code IN " . $search_string . " order by code;