Bonjour
Le code en rouge en dessous me renvoi le message suivant, alors que le code en cert me renvoie bien les valeurs
Pourquoi $ligne n'est pas reconnu en tableau

Warning: extract() expects parameter 1 to be array, null given in C:\wamp\www\BoutonRadio.php on line 35

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
45
46
<?php
/* Affiche un bouton Radio
*/
?>

<html>
<head>
<title>Type d'animaux</title>
</head>
<Body>
<?php

$user="root";
$host="localhost";
$password="";
$database="anicata";
$connexion = mysqli_connect($host,$user,$password,$database) 
			 or die ("Connexion impossible") ;

$rq = "Select distinct AnimalType from Animal order by AnimalType";
$result=mysqli_query($connexion, $rq) 
		Or die('Execution de la requête impossible');

echo "<div style='margin-left: .5in; margin-top: .5in'>
<p>&nbsp;
<p><b>Quel type d'animal ? </b>
<p>Choisissez dans la liste\n";

echo "<form action='traitement.php' method='post'>\n";
while ($ligne = mysqli_fetch_assoc($result)) {
        echo $ligne["AnimalType"];
    }
while ($ligne = mysqli_fetch_assoc($result));
	{
		extract($ligne);
		
		echo "<input type='radio' name='choix' value='$AnimalType'>
		  $AnimalType\n";
		 echo "<br>\n";
	}
	echo "<p><input type='submit'  value='Validez votre choix'>
	</form>\n";
?>
</div>
</Body>
</html>