proceed(); // function d'affichage function show_results($user_input, $nbr_lignes=0, $page=0, $id = 0) { global $nb_per_page, $rech_regexp; global $base_url; global $caller; global $class_path; global $no_display; global $charset; global $msg ; // on récupére le nombre de lignes $user_input = str_replace("*","%",$user_input); if($user_input=="") { $requete = "SELECT empr_cp, empr_ville FROM empr group by empr_cp, empr_ville "; } else { $requete = "SELECT empr_cp, empr_ville FROM empr where (empr_cp like '$user_input%' or empr_ville like '$user_input%') group by empr_cp, empr_ville "; } $res = pmb_mysql_query($requete); $nbr_lignes = pmb_mysql_num_rows($res); if(!$page) $page=1; $debut =($page-1)*$nb_per_page; if($nbr_lignes) { // on lance la vraie requête if($user_input=="") $requete = "SELECT empr_cp, empr_ville, count(id_empr) as nbre FROM empr group by empr_cp, empr_ville ORDER BY empr_cp, empr_ville LIMIT $debut,$nb_per_page "; else $requete = "SELECT empr_cp, empr_ville, count(id_empr) as nbre FROM empr where (empr_cp like '$user_input%' or empr_ville like '$user_input%') group by empr_cp, empr_ville ORDER BY empr_cp, empr_ville LIMIT $debut,$nb_per_page "; $res = pmb_mysql_query($requete); while(($cp_ville=pmb_mysql_fetch_object($res))) { print "