I'm wanting my while instead of creating the "element-item" block down, create the block up, that is it will sort from the newest to the oldest and not the oldest to the newest
EXAMPLE: What he's doing:
BLOCO ID1 - BLOCO ID2 - BLOCO ID3
What I want:
BLOCO ID3 - BLOCO ID2 - BLOCO ID1
My code:
<?php
$servidor = 'localhost';
$banco = 'apixel_galeria';
$usuario = 'root';
$senha = '';
$link = @mysql_connect($servidor, $usuario, $senha);
$db = mysql_select_db($banco,$link);
if(!$link)
{
echo "erro ao conectar ao banco de dados!";exit();
}
$sql = "SELECT * FROM portfolio";
$query = mysql_query($sql);
while($sql = mysql_fetch_array($query)){
$id = $sql["id"];
$nome = $sql["nome"];
$tipo = $sql["tipo"];
$desc = $sql["desc"];
$menu = $sql["menu"];
$imageM = $sql["imageM"];
$imageF = $sql["imageF"];
?>
<div class="element-item <?php echo "$menu";?>" data-category="transition">
<a href="#portfolioModal54" class="portfolio-link" data-toggle="modal">
<img src="<?php echo "$imageM"?>" alt="project 2">
<div class="mask"> <div class="conteudo_mask" style="
transform: translateY(-50%);
top: 50%;
position: relative;
/* float: left; */
"> <h1><?php echo "$nome"?></h1> <div id="lin" style="
width: 200px;
"></div> <h2><?php echo "$tipo"?></h2> </div><h3 style="
transform: translateY(-50%);
top: 50%;
position: relative;
">VEJA <br><img src="images/mais.png" alt="mais" style="width: 20px;height: 19px;margin-bottom: -1px;margin-top: 3px;"></h3></div>
</a>
</div>
<?php
}
?>