-2
With this code the order of the letters menu, sent by mysql table, does not appear in alphabetical order. The order that currently appears is A D T V C S F M. Someone can help me to solve this problem; that is, by alphabetizing the list of letters?
Page home code:
<?php
include 'conn.php';
$letter = mysqli_real_escape_string ($conn,htmlspecialchars(base64_decode($_GET["letter"])));
$sql = "SELECT Id,Palavra from dicionario_palavras where Pronta != 0 AND Palavra LIKE '".$letter."%'";
$result = $conn->query($sql);
$sql2 = "SELECT DISTINCT(SUBSTR(`Palavra`, 1, 1)) As abc from dicionario_palavras where Pronta != 0";
$result2 = $conn->query($sql2);
?>
Have you tried adding the
order by
in your SQL?– Woss
Yes I already have the order By well done: us_DefinicoesPalavras(asc).
– Meireles
Where is the
ORDER BY
in your query then ? I believe aORDER BY Palavra ASC
at the end of your query already solves the problem.– Leo
Ok Leo... already solved. Thank you very much for the tip. I published here below the solution.
– Meireles