Je dois faire afficher des photos qui sont classées par thème et par commune.
je permets à l'utilisateur lors de la recherche de cocher un ou plusieurs thèmes que je stocke dans un array (page recherche.php).
Dans ma page resultat.php, j'ai codé une pagination (plus de 8000 photos). J'arrive à récupérer la commune quand je clique sur la page suivante, mais pas les valeurs du tableau.
Quelqu'un peut il m'aider. Je poste la page resultat.php Merci d'avance

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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?php
 
	$tableautheme = $_POST['cbTheme'];
 
	if(isset($_GET['commune'])) {
		$ville = $_GET['commune'];}
	else{
		$ville = $_POST['commune'];}
 
	// Numéro de la page à afficher
	if(isset($_GET['page'])) {
		$page = $_GET['page'];
		echo "<p class='Formulaire' align='center'>Vous êtes sur la page $page.</p>";}
	else {
		$page = 0;
		echo "<p class='Formulaire' align='center'>Vous êtes sur la page $page.</p>";}
 
	// Nombre de résultats par page
	$nb = 1;
	if(isset($_GET['nb'])) {
	$nb = $_GET['nb'];}
 
	$critere = "";
 
	foreach( $tableautheme as $idtheme ) 
	{
		$critere = $critere."themes.NUM_THEME = $idtheme OR ";
	}
 
	$critheme = substr($critere, 0, -3);
 
	if($ville=="PCL") 
	{
		// Nombre total d'enregistrements
		$sql = "SELECT Count(NUMERO) "
		."FROM themes INNER JOIN (photos INNER JOIN photo_theme ON photos.NUM_PHOTO = photo_theme.NUM_PHOTO) ON themes.NUM_THEME = photo_theme.NUM_THEME "
		."WHERE $critheme ;";
 
		$query = mysql_query($sql,$connec) or die("erreur -> ".mysql_error());
 
		$row = mysql_fetch_row($query);
		$total = $row[0];
 
		// Nombre maximum de pages
		$max_pg = ceil($total / $nb);
 
		$sql = "SELECT themes.NOM_THEME, photos.NOM_PHOTO, photos.PHOTOGRAPHE, photos.NOM_PHOTO, photos.LIEU_DIT, photos.COMMUNE, photos.DATE, photos.COPYRIGHT, photos.CHEMIN "
		."FROM (themes INNER JOIN photo_theme ON themes.NUM_THEME = photo_theme.NUM_THEME) INNER JOIN photos ON photo_theme.NUM_PHOTO = photos.NUM_PHOTO "
		."WHERE $critheme ORDER BY themes.NOM_THEME, photos.COMMUNE "
		."LIMIT ".($page * $nb).",".$nb.";";
	}
	else
	{
		// Nombre total d'enregistrements
		$sql = "SELECT Count(NUMERO) "
		."FROM themes INNER JOIN (photos INNER JOIN photo_theme ON photos.NUM_PHOTO = photo_theme.NUM_PHOTO) ON themes.NUM_THEME = photo_theme.NUM_THEME "
		."WHERE $critheme AND photos.COMMUNE = '$ville';";
 
		$query = mysql_query($sql,$connec) or die("erreur -> ".mysql_error());
 
		$row = mysql_fetch_row($query);
		$total = $row[0];
 
		// Nombre maximum de pages
		$max_pg = ceil($total / $nb);
 
		$sql = "SELECT themes.NOM_THEME, photos.NOM_PHOTO, photos.PHOTOGRAPHE, photos.NOM_PHOTO, photos.LIEU_DIT, photos.COMMUNE, photos.DATE, photos.COPYRIGHT, photos.CHEMIN "
		."FROM (themes INNER JOIN photo_theme ON themes.NUM_THEME = photo_theme.NUM_THEME) INNER JOIN photos ON photo_theme.NUM_PHOTO = photos.NUM_PHOTO "
		."WHERE $critheme AND photos.COMMUNE = '$ville' ORDER BY themes.NOM_THEME "
		."LIMIT ".($page * $nb).",".$nb.";";		
	}
 
$query = mysql_query($sql,$connec) or die("erreur -> ".mysql_error());
 
while($ligne = mysql_fetch_assoc($query))
{
		$theme = $ligne['NOM_THEME'];
		$nom = $ligne['NOM_PHOTO'];
		$photographe = $ligne['PHOTOGRAPHE'];
		$lieu = $ligne['LIEU_DIT'];
		$ville = $ligne['COMMUNE'];
		$date = substr($ligne['DATE'], 0, 10);
		$copyright = $ligne['COPYRIGHT'];
		$chemin = $ligne['CHEMIN'];
 
echo"  
<table width='800' border='0' cellpadding='10' cellspacing='0' align='center'>
	<tr>
		<td width='200' class='cadreg'>
			<div align='center'>
				<p><img src=$chemin width='150' height='112' onload=this.style.filter='progid:DXImageTransform.Microsoft.Shadow(color=#000000,direction=135,strength=3)' BORDER='0'></p>
			 </div>
		 </td>
		 <td width='600' class='cadred'>
			 <div align='left'>
				 <span class='Resultat'>Thèmes : </span><span>$theme </span><br>
				 <span class='Resultat'>Photos : </span><span>$nom </span><br>
				 <span class='Resultat'>Photographe : </span><span>$photographe </span><br>
				 <span class='Resultat'>Lieu-dit : </span><span>$lieu </span><br>
				 <span class='Resultat'>Commune : </span><span>$ville </span><br>
				 <span class='Resultat'>Prise de vue : </span><span>$date </span><br>
				 <span class='Resultat'>Copyright : </span><span>$copyright </span><br>
			  </div>
		  </td>
	 </tr>
</table></br>";
}
 
//Affichage des numéros de pages
 
echo "<p align='center'>Pages : ";
 
for($i = 0 ; $i < $max_pg ; $i++) 
{
	//echo "<a href='?commune=".$ville."&cbTheme=".$tableautheme."&page=".$i."&nb=".$nb."' class='lienpage'>".$i." </a>";
	echo "<a href='?commune=".$ville."&page=".$i."&nb=".$nb."' class='lienpage'>".$i." </a>";
}
?>