$vals = array(2, 5, 8); // where $vals = "2, 5, 8"; $in = sql_in('id_table', $vals); if ($res = sql_select('column', 'table', $in)) { // ... }