par
Cyrano » 04 oct. 2005, 13:13
un "
;" mal placé à la fin de
while($soluce = pg_fetch_array($solution))
Et j'ai viré le paramètre excédentaire mentionné par
mere-teresa
Maintenant, on peut même faire ça en code XHTML propre et en PHP un peu arrangé pour le rendre plus facile à suivre:
<?php
echo("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<title></title>
<style type="text/css">
/* <![CDATA[ */
body {
background: #339966;
color: #FFFFFF;
font-family: Arial;
}
a:link {
color: #0066CC
}
a:visited {
color: #923FC1
}
a:active {
color: #0000FF
}
.ThRows {
background-color: #CC0033;
color: #FFFFFF;
font-weight: bold;
text-align: center;
font-family: Arial;
}
.TrRows {
background-color: #FFFFFF;
color: #000000;
font-family: Arial;
}
.TrOdd {
background-color: #FAF100;
color: #000000;
font-family: Arial;
}
/* ]]> */
</style>
</head>
<body>
<table border="1" cellpadding="4" cellspacing="1" summary="">
<tr>
<th class="ThRows">Nom</th>
<th class="ThRows">Prénom</th>
<th class="ThRows">Paiement</th>
</tr>
<?php
include("./Base/pgConnect.php");
$sql = "SELECT parnom, parprenom, dospaiement ".
"FROM participant, dossier ".
"WHERE participant.idparticipant = dossier.idparticipant ".
"ORDER BY parnom asc";
$solution = pg_query($Connect,$sql);
while($soluce = pg_fetch_array($solution))
{
?>
<tr>
<td class="TrOdd" align="left"><?php echo($soluce['parnom']); ?></td>
<td class="TrOdd" align="left"><?php echo($soluce['parprenom']); ?></td>
<td class="TrOdd" align="left"><?php echo($soluce['dospaiement']); ?></td>
</tr>
<?php
}
?>
</table>
</body>
</html>
Note que j'ai fait de petites corrections de détail: la première ligne du tableau contenant des titre, j'ai remplacé td par th, par exemple.
un "[color=red][b];[/b][/color]" mal placé à la fin de
[php]while($soluce = pg_fetch_array($solution)) [/php]
Et j'ai viré le paramètre excédentaire mentionné par [b]mere-teresa[/b]
Maintenant, on peut même faire ça en code XHTML propre et en PHP un peu arrangé pour le rendre plus facile à suivre:
[php]<?php
echo("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<title></title>
<style type="text/css">
/* <![CDATA[ */
body {
background: #339966;
color: #FFFFFF;
font-family: Arial;
}
a:link {
color: #0066CC
}
a:visited {
color: #923FC1
}
a:active {
color: #0000FF
}
.ThRows {
background-color: #CC0033;
color: #FFFFFF;
font-weight: bold;
text-align: center;
font-family: Arial;
}
.TrRows {
background-color: #FFFFFF;
color: #000000;
font-family: Arial;
}
.TrOdd {
background-color: #FAF100;
color: #000000;
font-family: Arial;
}
/* ]]> */
</style>
</head>
<body>
<table border="1" cellpadding="4" cellspacing="1" summary="">
<tr>
<th class="ThRows">Nom</th>
<th class="ThRows">Prénom</th>
<th class="ThRows">Paiement</th>
</tr>
<?php
include("./Base/pgConnect.php");
$sql = "SELECT parnom, parprenom, dospaiement ".
"FROM participant, dossier ".
"WHERE participant.idparticipant = dossier.idparticipant ".
"ORDER BY parnom asc";
$solution = pg_query($Connect,$sql);
while($soluce = pg_fetch_array($solution))
{
?>
<tr>
<td class="TrOdd" align="left"><?php echo($soluce['parnom']); ?></td>
<td class="TrOdd" align="left"><?php echo($soluce['parprenom']); ?></td>
<td class="TrOdd" align="left"><?php echo($soluce['dospaiement']); ?></td>
</tr>
<?php
}
?>
</table>
</body>
</html>
[/php]
Note que j'ai fait de petites corrections de détail: la première ligne du tableau contenant des titre, j'ai remplacé td par th, par exemple.