source de la page tp2.php


<html>
<body>
<p align="center">
<font size="5" face = "Arial"><b>Liste des Producteurs<br></b></font></p>

<?php
$link = db2_connect("AS400", "" , "");
$appel= $_POST['appel'];
$query = "select pr_nom, pr_commune from BDVIN1.producteurs
where appel_code = ".$appel." order by pr_nom";
?>
<hr>
<?php
$result = db2_exec($link, $query);
?>
R&eacute;sultat : <br><br>
<?php
if ($result == 0):
echo ("<B>Error " . db2_error() . ": " . db2_errormsg() . "</B>");
else :
?>
<TABLE BORDER=1>
<TR>

<?php
for ($i = 0; $i < db2_num_fields($result); $i++) {
echo("<TH>" . db2_field_name($result,$i) . "</TH>");
}
?>
</TR>
<?php
$lignetbl = db2_fetch_array($result);
while($lignetbl != FALSE) {
echo("<TR>");
for ($j = 0; $j < db2_num_fields($result); $j++) {
echo("<TD>" . $lignetbl[$j] . "</TD>");
}
echo("</TR>");
$lignetbl = db2_fetch_array($result);
}
?>
</TABLE>
<?php
db2_close($link);
endif
?>
</BODY>
</HTML>