Réponse acceptée !
bonjour
oracle
tu peux utiliser sql et where like
voilà un petit bout de mon moteur en php (pas du java)
assez facile à comprendre je pense pour un programmeur java
et à adapter
Code PHP :
echo 'Votre recherche <b>'.$arg_search.'</b> <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);
...