source de la page tp1.php

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

<?php
$link = db2_connect("AS400", "" , "");
$query="select Appellation, Region_code from BDVIN1.Appellations
order by Appellation
fetch first 50 rows only";
$result = db2_exec($link, $query);
?>
R&eacute;sultat : <br>
<table border ="1">
<tr>
<th><b>Appellation</th>
<th>Region_code</th>
</tr>

<?php
if ($result == 0){
echo ("<B>Erreur " . db2_error() . ": " . db2_errormsg() . "</B>");
} else {
$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);
}
?>
</BODY>
</HTML>