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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
| <?php
//Maintenant, on se connecte à la base de données
include("identifiant.php");
mysql_connect($adresse, $nom, $motdepasse);
mysql_select_db($database);
?>
<?php
$recherche = $_POST['personne'];
$requete = "SELECT * FROM annuaire WHERE Nom='".$recherche."';";
$exe= mysql_query($requete);
$resultat = mysql_fetch_assoc($exe);
if ($resultat)
{
//On affiche tous les résultats de la table annuaire correspondant au Nom choisi
echo "Nom : ";
echo $recherche; //Affiche le nom
echo '<br/>';
echo "Prenom : ";
echo $resultat["Prenom"]; //Affiche le prénom
echo '<br/>';
echo "Poste : ";
echo $resultat["Type_personnel"];// Affiche le statut
echo '<br/>';
echo "Equipe de Recherche : ";
echo $resultat["Libelle_Equipe"];//affiche le nom de l'équipe
echo " (";
echo $resultat["Equipe"]; //Affiche le nom de l'équipe en abrégé
echo ")";
echo '<br/>';
echo "Numéro de téléphone : ";
echo $resultat["Telephone"];//Affiche le téléphone
echo '<br/>';
echo "Email : ";
echo $resultat["Mail"];//Affiche le mail
echo '<br/>';
echo "Fonction : ";
echo $resultat["fonction"];//affiche la fonction
echo '<br/>';
echo "Bureau : ";
echo $resultat["Bureau"];//affiche le bureau
echo '<br/>';
echo "Appartenance : ";
echo $resultat["Appartenance"];//affiche son appartenance
}
else
{
echo"<p>ca marche pas</p>";
echo $recherche;
}
?>
<?php
$recherche2 = $_POST['equipe'];
$requete2 = "SELECT * FROM annuaire WHERE Equipe='".$recherche2."';";
$exe2= mysql_query($requete2);
$resultat2 = mysql_fetch_assoc($exe2);
if ($resultat2)
{
//On affiche tous les résultats de la table annuaire correspondant au Nom choisi
while($resultat2)
echo $resultat2['Nom'];
}
else
{
echo"<p>ca marche pas formulaire2</p>";
echo $recherche;
}
?> |