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 47 48 49 50 51
| <?
$db=mysql_connect('localhost','nom','mot de pass') or die('Erreur de connexion');
mysql_select_db('test',$db)or die('bd introuvable');
//mysql_query("INSERT INTO etudiant VALUES('1','4-04-2002','webmestre','webmaster@az-php.com')");
//mysql_query("INSERT INTO etudiant VALUES ( '2', '4-04-2002', 'pierre', 'email@pierre.com')");
$req = mysql_query("SELECT * from client ");
/*
while ( $resultat = mysql_fetch_array($req))
{
echo 'id :'.$resultat['id'].' date ->'.$resultat['date'].' nom->'.$resultat['nom'].' email ->'.$resultat['email'].'<br>';
}*/
echo '<table border="1" align="center" ><tr>';
echo '<th>';
echo 'numero';
echo '</th>';
for ($i = 0; $i < mysql_num_fields($req); $i++) {
echo '<th>';
echo mysql_field_name($req, $i);
echo '</th>';
}
echo '</tr>';
//debut remplissage des donnees
$n=0;
while ($row = mysql_fetch_row($req)) {
echo '<tr>';
echo '<td>';
echo '<INPUT TYPE="checkbox" NAME="aff " VALUE="'.$n.'" >' ;
$n++;
echo '</td>';
for ($j = 0; $j < count($row); $j++) {
echo '<td>';
echo ($row[$j] == NULL) ? '<i>NULL</i>' : $row[$j] ;
echo '</td>';
}
echo '</tr>';
}
echo '</table>';
echo' <div align="center">'.'<a href="C:\Program Files\EasyPHP1-8\www\affiche\aff.html" title="retour">retour</a>';
mysql_close();
?> |
Partager