1
2<?php
3mysql_connect("localhost", "mysql_user", "mysql_password") or
4die("Impossible de se connecter : " . mysql_error());
5mysql_select_db("mydb");
6
7$result = mysql_query("SELECT id, name FROM mytable");
8
9while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
10 printf("ID : %s Nom : %s", $row[0], $row[1]);
11}
12
13mysql_free_result($result);
14?>
15
16