Bonjour,
Je souhaite afficher toute les variable d'une table dans une BDD qui et créer sur phpmyadmin.
J'ai fait un code mais je voit pas ce l'erreur que j'ai fait, quand je l'exécute avec mon localhost sur mon pc il me mais que la ligne 22 il y a une erreur. Je vois pas ce qu'il faut ajouter ou modifier les argument du while.
Merci d'avance pour vos réponse
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 <html> <head><title>Liste capteurs</title></head> <link href="css/style.css" rel="stylesheet" media="all" type="text/css"> <body> <h1>Liste capteur : </h1> <?php // on se connecte à MySQL et on sélectionne la base $conn = new mysqli('localhost', 'root', '', 'air_exterieur'); if ($conn->connect_errno) { echo "Echec lors de la connexion à MySQL : " . $conn->connect_error; } // On créé la requête $req = "SELECT * FROM boitier_qae ORDER BY NOM, Num_boitier"; // on envoie la requête $res = $conn->query($req); // on va scanner tous les tuples un par un echo "<table class='paleBlueRows' >"; while($data = mysqli_fetch_array($res)) { // on affiche les résultats echo "<tr> <td>".$data['Num_boitiers']."</td> <td>".$data['Date_Heure']."</td> <td>".$data['PM0_3']."</td> <td>".$data['PM0_5']."</td> <td>".$data['PM1']."</td> <td>".$data['PM2_5']."</td> <td>".$data['PM5']."</td> <td>".$data['PM10']."</td> <td>".$data['Latitude']."</td> <td>".$data['Longitude']."</td>"; echo "</tr>" ; } echo "</table>"; // on ferme la connexion $conn->close(); ?> </body> </html>
Baptiste
Partager