Bonjour,

J'ai créé tois encadrement différent pour mes photos en fonction que celles ci soit dans un format large, haut ou panoramique.

J'ai donc utilisé la fonction IF qui doit changer le contenu de mes TD par rapport au type de photo L, H ou P qui se trouve dans un champs de ma table photo.

Actuellement je n'ai pas d'erreur de syntaxe à priori sur ma page mais ça ne m'affiche plus aucun fond dans mes TD.

Voilà mon code :

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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
 $sql = "SELECT *
         FROM albums
         JOIN photos ON albums.num_album = photos.num_album
         WHERE photos.num_photo = ".(int)$_GET['numphoto'];
         $result = mysql_query($sql) or die ('Erreur SQL : impossible d\'effectuer la requête : <br />'.$sql);
         for($i=0;$i<mysql_num_rows($result);$i++)
         {
          $row=mysql_fetch_assoc($result);
 
echo '<table width="100%">';
echo '<tr>';
echo '<td width="100%" align="center">';
echo '<table width="650" border="0" cellspacing="0" cellpadding="0">';
echo '<tr>';
 
if ('.$row["type_photo"].'=="L") {
echo '<td background="images/menu/fdphotoL_01.jpg" width="650" height="30" align="center"><span class="titre2">'.$row["nom_photo"].'</span></td>';
echo '</tr>';
echo '</table>';
echo '<table width="650" border="0" cellspacing="0" cellpadding="0">';
echo '<tr>';
echo '<td background="images/menu/fdphotoL_02.png" width="650" height="620" align="center"><img border="0" src="images/albums/' . $row['nom_album'] . '/' . $row['img_photo'] . '" /></td>';
 
} else if ('.$row["type_photo"].'=="H") {
echo '<td background="images/menu/fdphotoH_01.jpg" width="650" height="30" align="center"><span class="titre2">'.$row["nom_photo"].'</span></td>';
echo '</tr>';
echo '</table>';
echo '<table width="650" border="0" cellspacing="0" cellpadding="0">';
echo '<tr>';
echo '<td background="images/menu/fdphotoH_02.png" width="650" height="620" align="center"><img border="0" src="images/albums/' . $row['nom_album'] . '/' . $row['img_photo'] . '" /></td>';
 
} else {		
echo '<td background="images/menu/fdphotoP_01.jpg" width="650" height="30" align="center"><span class="titre2">'.$row["nom_photo"].'</span></td>';
echo '</tr>';
echo '</table>';
echo '<table width="650" border="0" cellspacing="0" cellpadding="0">';
echo '<tr>';
echo '<td background="images/menu/fdphotoP_02.png" width="650" height="620" align="center"><img border="0" src="images/albums/' . $row['nom_album'] . '/' . $row['img_photo'] . '" /></td>';
}		
 
echo '</tr>';
echo '</table>';
echo '</td>';
echo '</tr>';
echo '</table>';
         }
?>
Si qqun voit le soucis merci de m'éclairer.

Merci