Bonjour,

J'ai un petit soucis avec mon If lorsque je l'inclus dans ma page ma requête ne m'affiche que le premier résultat qu'elle trouve.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
<?php
 $sql2 = "SELECT COUNT(commentaires.num_com) AS com, commentaires.nom_dep, commentaires.com_dep,commentaires.num_photo, photos.num_photo, photos.nom_photo, photos.img_photo, photos.vig_photo, photos.ouverture_photo, photos.vitesse_photo, photos.focale_photo, photos.iso_photo, photos.type_photo, photos.num_album
          FROM commentaires
          JOIN photos ON commentaires.num_photo = photos.num_photo
          WHERE photos.num_photo = ".(int)$_GET['numphoto'];
         $result2 = mysql_query($sql2) or die ('Erreur SQL : impossible d\'effectuer la requête : <br />'.$sql2);         		    
		  for($i=0;$i<mysql_num_rows($result2);$i++)
         {
          $row2=mysql_fetch_assoc($result2);
if ($row2['com'] == 0) { }
 
else {
echo '<tr>';
echo '<td width="610" height="10" background="images/menu/espaceh.png"></td>';
echo '</tr>';
echo '<tr>';
echo '<td width="610" height="20" background="images/menu/com01L.png" align="left" valign="middle"><span class="exifs">&nbsp;D&eacute;posant : <span class="titre">'. $row2['nom_dep'] .'</span></span></td>';
echo '</tr>';
echo '<tr>';
echo '<td width="610" height="76" background="images/menu/com02L.png" valign="top">
      <table><tr><td width="1"></td>
	  <td><span class="texte">'. $row2['com_dep'] .'</span></td>';
echo '</tr>';
echo '</table>';
} }
echo '</td>';
echo '</tr>';
echo '</table>';
echo '</td>';
echo '</tr>';
echo '</table>';       
?>
Merci pour votre aide