1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
<PHP
if (isset($_POST["recherche"])) $re=trim($_POST["recherche"]);
else $re="";
if ($re!="")
{
// ====== on se log a MYSQL
$Flag1=mysql_connect($Serveur,$User,$Mdp) OR die('Erreur connexion ');
$Flag2=mysql_select_db($MaBase) OR die('Erreur connexion ');
$result=mysql_query( "select * from mestables
WHERE Nom >= '' and Nom<'zzzzzzzzzzzzzz' ");
while ($row=mysql_fetch_array($result))
{
$Nom= stripslashes($row['Nom']);
$controle=strpos($Nom,$re);
if ($controle !== false) { echo $Nom}
}
mysql_close();
}
<form action="test.php" method="POST" >
<input type="text" name="recherche" size="20" value="" /><br />
<input type="submit" name="Submit" value=" RECHERCHE ">
</form> |
Partager