Prob pour faire un glossaire - en php/mysql

salut, jai dans ma base de données une table glossaire comprenant des mots et leur definitions. Je voudrais afficher cela sur la page.
En haut de la page il y a les lettres avec l’ancre sur une letre de l’alphabet comme ceci :

 <td width="43" height="24"><p align="center"><a href="#a"><strong>A</strong></a></p></td>
      <td width="36"><p align="center"><strong><a href="#b">B</a></strong></p></td>
      <td width="32"><p align="center"><strong><a href="#c">C</a></strong></p></td>
.
.
.

et donc en dessous je voudrais afficher les mots. J’ai fais ça mais ca marche pas :

	
	$req="SELECT DISTINCT motGlos FROM glossaire ORDER BY motGlos";
	$query=mysql_query($req);
	while($res=mysql_fetch_array($query))
	{
  $taille=strlen($res['motGlos']);
  $pl=substr($res['motGlos'],0,$taille-$taille+1);
	?>
    
	<tr>
      <td valign="top" bgcolor="#CC0000"><h1 class="Style1"><?php echo "<a name='$pl'><a>$pl" ?></h1></td>
    </tr>
	<?php
	$req2="SELECT * FROM glossaire ORDER BY motGlos";
	$query2=mysql_query($req2);
	$res2=mysql_fetch_array($query2);
	while($pl=$pl=substr($res['motGlos'],0,$taille-$taille+1))
	{
  echo"<tr><td>".$res2['definitionGlos']."</td></tr>";
	}
	?>
	<?php
	}?>

la premiere boucle while marche seulement il m’affiche 4 fois la ligne A si il y a 4 mots commencant par A dans la base. Et la 2eme boucle pose probleme, impossible de voir le resultat car ça charge trop. Qqn pourrait m’aider svp ?

$taille-$taille+1

8-8+1 = 1 tu n’affiches qu’un caractère dans ton substring :lol:

oui c’est normal, c’est pour l’ancre

Non mais ce qu’il te dit c’est que $taille - $taille = 0 == opération inutile