1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| <?php
session_start();
if(isset($_POST['submit'])){
if(empty($_POST['recherche'])){
$erreur = 'Le champ recherche est vide';
}
else{
require 'config.php';
$connexion_sql = mysql_connect(DB_HOST,DB_LOGIN,DB_PASS);
$connexion_bdd = mysql_select_db(DB_BDD);
$recherche = mysql_real_escape_string($_POST['recherche']);
$lecture = mysql_query("SELECT * FROM membre,article WHERE pseudo,titre,nom,prenom LIKE '%$recherche%'") or die;
$retour = mysql_fetch_array($lecture);
print_r($retour);
}
}
?>
<form method="post">
<input type="text" name="recherche">
<input type="submit" name="submit">
</form> |