echo 'Votre recherche '.$arg_search.' <hr size="1">'; /*connect to database*/ @mysql_connect(HOST,LOGIN,PASSWORD) or die('DATABASE 0 ?'); @mysql_select_db(DB) or die('DATABASE 1 ?'); /*petite protection facile*/ mysql_real_escape_string($arg_search); /*on eclate les items on construit un tableau*/ $search_exploded = explode(" ",$arg_search); $construct=""; $x=0; foreach($search_exploded as $search_each) { /*construction de la query*/ if ($x==0) {$construct .= "nom LIKE '%$search_each%'";} else {$construct .= " OR nom LIKE '%$search_each%'";} $x++; } //echo $construct;exit; $construct = 'SELECT * FROM '.TB.' WHERE '.$construct; $run = mysql_query($construct);
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question