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
|
// on se connecte à MySQL
$db = mysql_connect('localhost', 'root', '');
// on seléctionne la base
mysql_select_db('base',$db);
//requete de recherche
$requete = "SELECT * from tmp_personne, corps, fonction WHERE nom_p LIKE '%$n%' AND tmp_personne.corps=corps.id_corps AND tmp_personne.fonction=fonction.id_fonc";
//boucle pour afficher les resultats
if (!($resultat = mysql_query($requete))) {
echo "erreur requete";
}
$ligne = mysql_fetch_array($resultat);
while($ligne) {
echo $ligne ["nom_p"], " ", $ligne["prenom_p"], " ", "<br>", $ligne["labo"], " ", "<br>", $ligne["corps"], " ", "<br>", $ligne["fonction"], " ", "<br>",$ligne["tel"], " ", "<br>", $ligne["mail"]," <br><hr>";
$ligne = mysql_fetch_array($resultat);
}
?> |
Partager