I'm doing this insipid query:
$sql = "SELECT * FROM noticias WHERE vigente=1 ORDER BY fecha DESC";
date is a DATETIME field. Theoretically you have to sort the result from the most recent to the oldest ... well, in PHPMyAdmin it works perfect ... then when I put it in the table it does what it wants! ... The strange thing is that for example probe
$sql = "SELECT * FROM noticias WHERE vigente=1 ORDER BY id DESC";
not showing the id field in the table. In PHPMyAdmin it also works perfect, but as I do not show the id field in the table I thought "there is half crafty and if the field is not there ignores the ordering" (one at this point does not know what nonsense to think) well, to try add the field id in the table and it happened exactly the same ... do what you sing in earns ... I want to clarify that in the table I place: title, summary, date (of publication), nothing more The result of that query I store it in
$resultado = $mysqli->query($sql);
and further down in the "tbody" I do
<?php while($row = $resultado->fetch_array(MYSQLI_ASSOC)) { ?>
the problem would have to be in one of those parts ... because if the query is fine, I load the result of the query well ... then ...