par
Cyrano » 28 juin 2005, 10:07
NOrmal, tu devrais avoir le mysql_fetch_assoc dans une boucle:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" xml:lang="fr" />
<title></title>
</head>
<body>
<?php
$host = '**********';
$user = '***********';
$pass = '*************';
$db = '***********';
// connection à la DB
$link = mysql_connect ($host,$user,$pass) or die ('Erreur : '.mysql_error() );
mysql_select_db($db) or die ('Erreur :'.mysql_error());
$select ="select * from fournisseur ";
$result = mysql_query($select,$link) or die ('Erreur : '.mysql_error() );
?>
<table border=1>
<TR bgcolor=\"#CCFFCC\">
<TH>Fournisseur</TH>
<TH>Reduction</TH>
<TH>Frais de Saic</TH>
</TR>
<?php
while($row = mysql_fetch_assoc($result))
{
?>
<tr>
<td><font face='Verdana' size='2'><?php echo($row['fournisseur2']); ?></font></td>
<td><font face='Verdana' size='2'><?php echo($row['reduction']); ?></font></td>
<td><font face='Verdana' size='2'><?php echo($row['autres']); ?></font></td>
</tr>
<?php
}
?>
</table>
</body>
</html>
[Edit]Pris de vitesse par
Cerber, mais on se rejoint. Note quand même que je suis plus tatillon sur la méthode d'indentation et de séparation php/html[/Edit]
NOrmal, tu devrais avoir le mysql_fetch_assoc dans une boucle:
[php]<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" xml:lang="fr" />
<title></title>
</head>
<body>
<?php
$host = '**********';
$user = '***********';
$pass = '*************';
$db = '***********';
// connection à la DB
$link = mysql_connect ($host,$user,$pass) or die ('Erreur : '.mysql_error() );
mysql_select_db($db) or die ('Erreur :'.mysql_error());
$select ="select * from fournisseur ";
$result = mysql_query($select,$link) or die ('Erreur : '.mysql_error() );
?>
<table border=1>
<TR bgcolor=\"#CCFFCC\">
<TH>Fournisseur</TH>
<TH>Reduction</TH>
<TH>Frais de Saic</TH>
</TR>
<?php
while($row = mysql_fetch_assoc($result))
{
?>
<tr>
<td><font face='Verdana' size='2'><?php echo($row['fournisseur2']); ?></font></td>
<td><font face='Verdana' size='2'><?php echo($row['reduction']); ?></font></td>
<td><font face='Verdana' size='2'><?php echo($row['autres']); ?></font></td>
</tr>
<?php
}
?>
</table>
</body>
</html>[/php]
[Edit]Pris de vitesse par [b]Cerber[/b], mais on se rejoint. Note quand même que je suis plus tatillon sur la méthode d'indentation et de séparation php/html[/Edit]