source: trunk/xgraph/xfel9.php@ 42

Last change on this file since 42 was 42, checked in by marrucho, 11 years ago
File size: 753 bytes
Line 
1<?php
2$db = mysql_connect('127.0.0.1', 'root', ''); // connexion
3mysql_select_db('testwifi',$db); // selection
4
5$req = mysql_query('SELECT a,b,c,d FROM numeropaire');// requete
6$res = mysql_num_rows($req); // compte le nb d'enregistrements
7echo 'Il y a '.$res.' enregistrement(s) dans la table testwifi : ';// affichage du resultat
8
9// on fait une boucle qui va faire un tour pour chaque enregistrement
10$index=0;
11while($data = mysql_fetch_assoc($req))
12 {
13 // on affiche les informations de l'enregistrement en cours
14 echo '(',$index,')' . $data['a'] . ' ' . $data['b'] . ' ' . $data['c'] . ' ' . $data['d'] . ' - ' ;
15 $index++;
16 }
17
18mysql_close($db);// fermeture connexion
19?>
Note: See TracBrowser for help on using the repository browser.