Line | |
---|
1 | <?php |
---|
2 | $db = mysql_connect('127.0.0.1', 'root', ''); // connexion |
---|
3 | mysql_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 |
---|
7 | echo '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; |
---|
11 | while($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 | |
---|
18 | mysql_close($db);// fermeture connexion |
---|
19 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.