Bonjour, j'ai plusieurs requettes imbriquées avec des while... et voici mon probleme :

1 ere requette tout va bien, je fais un mysql_num_rows et j'ai le bon compte, mais apres quand je rentre dans ma boucle (qui marche parfaitement d'habitude) , il me zappe uniquement ma premiere ligne, j'utilise un script qui fait du page par page en + .

Il me zappe toujours ma premiere ligne !

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
<?php 
 
 
if(!isset($_GET['pg'])){ 
    $pg = 1; 
}else{ 
    $pg = $_GET['pg']; 
} 
 
 
if(!is_numeric($pg)){ 
    $pg = 1; 
} 
 
$link = mysql_connect($dbhost,$dbuser,$dbpass)or die("Erreur de connexion: ".mysql_error($link)); 
 
mysql_select_db($dbname, $link)or die("Erreur de connexion: ".mysql_error($link)); 
 
 
$enreg_par_pg = 20; 
 
 
function pgs($enreg_par_pg, $pg, $link){ 
    $res = mysql_query("SELECT * FROM details_profils_roles", $link)or die("Erreur MySQL: ".mysql_error($link)); 
    $nb_enreg = mysql_num_rows($res); 
 
    $nb_pg_rounded = ceil( $nb_enreg / $enreg_par_pg );     
 
    $pp = $pg - 1; 
 
    $ps = $pg + 1; 
 
 
    if($pg != 1){ 
 
        echo "<a href='?pg=$pp'>&lt;&lt;page pr&eacute;c&eacute;dente</a>"; 
    } 
 
 
    $i=0; 
 
        do{ 
 
        if($i != $pg){ 
 
            echo "&nbsp;<a href='?pg=$i'>$i</a>\n"; 
        }else{ 
 
            echo "&nbsp;$i&nbsp;"; 
        } 
       $i++; 
    }while($i <= $nb_pg_rounded); 
 
 
    if($pg != $nb_pg_rounded){ 
 
        echo "&nbsp;<a href='?pg=$ps'>page suivante&gt;&gt;</a>"; 
    } 
} 
 
 
$limit = $enreg_par_pg*$pg-$enreg_par_pg; 
 
 
$req = mysql_query("SELECT IdDetailProfilRole, IdProfilGassi, IdRoleApplicatif FROM details_profils_roles ")or die("Erreur MySQL: ".mysql_error($link)); 
$data=mysql_fetch_array($req);
 
 
	echo "<div align='center' class='Titre'>Consultation des Profils Gassi<br /><span class='menu'>Liste des rôles affectés à un Profil Gassi</span></div>
	<table width='720' border='0' align='center' cellpadding='10' cellspacing='1'>
	<tr valign='top'>
 <th>Profil Gassi</th>
 <th>Rôle Applicatif</th>
		<th>Details</th>

	</tr>";
 
 
while($temp=mysql_fetch_assoc($req)){
	$query2 = "SELECT details_profils_roles.IdDetailProfilRole, details_profils_roles.IdProfilGassi, profils_gassi.ProfilGassi, details_profils_roles.IdRoleApplicatif, roles.RoleApplicatif FROM details_profils_roles, profils_gassi, roles WHERE details_profils_roles.IdDetailProfilRole='".$temp['IdDetailProfilRole']."' AND roles.IdRoleApplicatif='".$temp['IdRoleApplicatif']."' AND profils_gassi.IdProfilGassi='".$temp['IdProfilGassi']."'"; 
	$result2 = @mysql_query ($query2) or die (mysql_error());
 
 
 
	while($temp2=mysql_fetch_assoc($result2)){
	echo "<tr valign='top' class='TDDonnees' onmouseover=\"setPointer('over', this, '#FFFFFF', '', '', '')\" onmouseout=\"setPointer('out', this, '#f5f5f5', '', '', '')\">
	<td >".$temp2['ProfilGassi']."</td>
   <td >".$temp2['RoleApplicatif']."</td>";
	  }
  }
 
  echo "</tr></table>";
 
 
echo "<div align='center'><span class='menu'><p></span>";
pgs($enreg_par_pg, $pg, $link);
echo "<p>"; 
 
?>
Merci