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 52 53
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Lecture de la table modéle</title>
<style type="text/css">
table{border-style:double;
border-width:3px;
border-color:red;
background-color:yellow;
}
</style>
</head>
<body>
<?php
include("connex.inc.php");
$idcom=connex("voitures","connex");
$requete="select * from modele order by modele";
$result=@mysql_query($requete,$idm);
if(!$result)
{
echo "lecture imossible";
}
else
{
$nbrmod=mysql_num_rows($result);
$ligne=mysql_fetch_array($result,MYSQL_ASSOC);
echo "<h3>Tous les modeles</h3>";
echo "<h4>il y'a $nbrmod de models</h4>";
echo "<table border=\"1\"><tr>";
foreach($ligne as $nomcol=>$valcol)
{
echo "<th>$nomcol</th>";
}
echo "<tr>";
do {
echo "<tr>";
foreach($ligne as $valcol){
echo "<td>$valcol</td>";
}
echo "</tr>";
}
while($ligne=mysql_fetch_array($result,MYSQL_NUM));
echo "</table>";
}
?>
</body>
</html> |