hier is a possible solution;
<?php
global $wpdb, $bp;
$result = $wpdb->get_results("SELECT user_id FROM wp_bp_xprofile_data WHERE
value = '$_POST[language]' OR value = '$_POST[budget]'
OR value = '$_POST[style]'LIMIT 0 , 30");
$str_ids = '';
foreach($result as $r) {
$str_ids .= ('' == $str_ids) ? '' : ', ';
$str_ids .= $r->user_id;
}
print_r($str_ids);