Re Bonjour,
C'est encore moi le débutant qui souffre.
je n'arrive pas à comprendre l'erreur
Voici le code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Exemple Appel Fonction requête SQL</title>
</head>
 
<body>
<?php 
/* appel de la fonction EXTRACTION DES DONNEES */
$infoID = extraireinfos("1143");  		
/* RECUPERATION DES DONNEES */
/* Exemple de Lecture des lignes avec Extract */
$ligne = mysqli_fetch_assoc($resultat);
extract($ligne);
if ($Identifiant == $infoID)
  {
   echo 'Identifiant: $Identifiant';
   echo 'Nom: $nom';
   echo 'Prénomom: $nom';
 
   }
else 
   echo 'pas trouvé';
 
?>
</body>
</html>
<?php 
function extraireinfos($Identifiant)  
{
$hote = "localhost";
$utilisateur = "root";
$mPasse = "";
$nombase = "Anciens élèves";
$connexion = mysqli_connect($hote, $utilisateur, $mPasse, $nombase) or die ("Connexion au serveur impossible.");
/* Attention le nom de la table doit être mis entre ` `  ce ne sont pas des quotes' '.
 Voir si on peut le changer dans le serveur SQL */
$requete = "SELECT nom,prénom,entrée_berthelot,sortie_berthelot FROM `cotisants 2009` WHERE Identifiant='$Identifiant'";
$resultat = mysqli_query($connexion, $requete) or die ("Execution requête SQL impossible");
return mysqli_fetch_assoc($resultat);
}
?>
et voici l'erreur:

Notice: Undefined variable: resultat in C:\wamp\www\TESTPHP\Fonction Exploitation Requete SQL.php on line 14

Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, null given in C:\wamp\www\TESTPHP\Fonction Exploitation Requete SQL.php on line 14

Warning: extract() expects parameter 1 to be array, null given in C:\wamp\www\TESTPHP\Fonction Exploitation Requete SQL.php on line 15

Notice: Undefined variable: Identifiant in C:\wamp\www\TESTPHP\Fonction Exploitation Requete SQL.php on line 16
pas trouvé.

Désolé et Merci d'avance pour votre aide au debug.