Hell'O,


J'ai un problème (encore un ), j'ai fais un système de tuto, mais ça ne s'affiche pas comme je le voudrais.
ça devrait afficher quelque chose comme ça:

- Partie 1
-- Chapitre 1
--- sous-chapitre 1
--- sous-chapitre 2
--- sous-chapitre 3

Mais ça m'affiche ça :

- Partie 1
-- Chapitre 1
--- sous-partie 1
- Partie 1
-- Chapitre 1
--- sous-partie 2
- Partie 1
-- Chapitre 1
--- sous-partie 3

Biensurs, si il y a une autre partie ou un autre chapitre ça doit afficher quelque chose comme ça :

- Partie 1
-- Chapitre 1
--- sous-chapitre 1
--- sous-chapitre 2
--- sous-chapitre 3

-- Chapitre 2
--- sous-chapitre 1
--- sous-chapitre 2
--- sous-chapitre 3

Partie 2
-- Chapitre 1
--- sous-chapitre 1
--- sous-chapitre 2
--- sous-chapitre 3

-- Chapitre 2
--- sous-chapitre 1
--- sous-chapitre 2
--- sous-chapitre 3

Alors voici ma requête et mon affichage :

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
<?php
$req = mysql_query('SELECT cours_partie_offi.id AS id_cours_partie_offi,
						   cours_partie_offi.id_cours,
						   cours_partie_offi.nom AS nom_partie,
						   cours_partie_offi.description,
						   chapitre_offi.id AS id_chap_offi,
						   chapitre_offi.id_partie,
						   chapitre_offi.nom AS nom_chap,
						   chapitre_offi.miniature,
						   sous_partie_offi.id AS id_sp,
						   sous_partie_offi.id_chapitre,
						   sous_partie_offi.nom
						   FROM cours_partie_offi
						   LEFT JOIN chapitre_offi ON cours_partie_offi.id = chapitre_offi.id_partie 
						   LEFT JOIN sous_partie_offi ON chapitre_offi.id = sous_partie_offi.id_chapitre
						   WHERE cours_partie_offi.id_cours=1 AND cours_partie_offi.id = chapitre_offi.id_partie AND chapitre_offi.id = sous_partie_offi.id_chapitre')or die (mysql_error());
while($donnees = mysql_fetch_array($req))
	{
?>
<div class="tuto-corps">
<div class="titre-tuto"><?php echo stripslashes($donnees['nom_partie']); ?></div>
<div class="tuto-contenu">
 
<?php echo bbcode(stripslashes($donnees['description']));?>
<br /><br />
<?php 
echo '<a href="affichage-cours.php?c='.$donnees['id_chap_offi'].'">';
echo stripslashes($donnees['nom_chap']);?>
</a><br />
<img src="<?php echo $donnees['miniature'];?>" class="flot_gauche"/>
<?php
echo '<a href="affichage-cours.php#'.$donnees['id'].'?c='.$donnees['id_chap_offi'].'">';
echo stripslashes($donnees['nom']);?></a><br />
<?php
}
?>

J'espère que vous pourrez m'aider