0 && mysql_num_rows($result)!=FALSE ){ while ($row = mysql_fetch_assoc($result)) { $items[$row['codNaf5']] = "".$row['libNaf5'].""; } //Envoi des informations $separator = " , "; foreach ($items as $key=>$value) { if (strpos(strtolower($key), $q) !== false || strpos(strtolower($value), $q) !== false ) { $output[] = array( 'label' => $key . $separator . $value, 'value' => $key ); } } } echo json_encode($output); ?>