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
| $requete = "SELECT * FROM france
LEFT JOIN region
ON france.avatar = region.id
LEFT JOIN departement
ON france.avatar = departement.id ";
$envoi = mysql_query($requete)or die(mysql_error());
// début du tableau ( hors boucle )
while($tableau = mysql_fetch_array($envoi))
{
?>
<tr>
<td width="100" align="center" valign="top" bgcolor="#DCDCDC"><?php echo $tableau['nom'];?></td>
<td width="100" align="center" valign="top" bgcolor="#DCDCDC"><?php echo $tableau['nom'];?></td>
<td width="100" align="center" valign="top" bgcolor="#DCDCDC"><?php echo $tableau['prenom'];?></td>
<td width="100" align="center" valign="top" bgcolor="#DCDCDC"><?php echo $tableau['taille'];?></td>
<td width="100" align="center" valign="top" bgcolor="#DCDCDC"><?php echo $tableau['poid'];?></td>
</tr>
<tr>
<td width="100%" colspan="4" align="left" valign="top">
<?php
$destination = $tableau['avatar']; //destination des images
$dimensions = @getimagesize($destination);
if($dimensions[0]<=120 && $dimensions[1]<=120) //si la longueur et inférieure ou égale à 120 de même pour la largeur
{
echo'<img src="'.$tableau['avatar'].' " class="imageflottante" />';
}
else
{
echo'<img src="'.$tableau['avatar'].' " class="imageflottante" style="width:auto; height:150px;" />';
}
?><?php echo $tableau['description'];?>
</td>
</tr>
<tr>
<td colspan="4">---------------------------------------------------------------------------</td>
</tr>
<?php |
Partager