Barre de recherche

Fermé
Jennifer - Modifié par Jennifer le 9/03/2017 à 12:59
Konseil Messages postés 643 Date d'inscription samedi 29 août 2015 Statut Membre Dernière intervention 13 novembre 2018 - 9 mars 2017 à 13:00
Bonjour,
Ma barre de recherche ne fonctionne pas puis-je trouver de l'aide
$articles=$conn->query('SELECT * FROM Medecin ORDER BY Num_med DESC');

if(isset($_GET['q']) AND !empty($_GET['q'])){
$q=htmlspecialchars($_GET['q']);
$q_array=explode('',$q);

var_dump($q);
var_dump($q_array);
$articles=$conn->query('SELECT * FROM Medecin WHERE Nom_med LIKE "%'.$q.'%"ORDER BY Nom_med');
}
?>
<form methode ="GET">
<input placeholder="Recherche..." type="search" value="" name="q">
<input type="submit" value="valider">
</form>

<?php

if ($articles->rowCount() > 0) {
// output data of each row
while($a = $articles->fetch()) {
echo '<tr><td>'.'<input type="radio" name="motif" value="Num_med" style="float:right">'.
'</td><td>'.$a['Num_med'] .'</td><td>'.$a['Nom_med'].'</td><td>'.$a['Prenom_med'].
'</td><td>'.$a['Email_med'].'</td></tr>';
}
}

else { ?> aucun résultat!!

<?php }



$conn->close();
?>

1 réponse

Konseil Messages postés 643 Date d'inscription samedi 29 août 2015 Statut Membre Dernière intervention 13 novembre 2018 428
9 mars 2017 à 13:00
Il n'y a pas de e à methode
<form method="GET">
0