codice:
$temp=array();
$st=mysql_query("SELECT id_nome FROM tabella") or die(mysql_error());
while ($row=mysql_fetch_assoc($st))
    $temp[]=$row['id_nome'];
$id_nome=implode(",",$temp);