I want to configure a button so that whenever I press the LOAD button + the limit 18 always add +18.
EXAMPLE: $ sql="SELECT * FROM portfolio ORDER BY id DESC limit 18";
CLICKED BUTTON
$ sql="SELECT * FROM portfolio ORDER BY id DESC limit 36";
CLICKED BUTTON
$ sql="SELECT * FROM portfolio ORDER BY id DESC limit 54";
I've put this limit to rearrange the layout and appear only 18 blocks on my site and always carry +18 at the push of a button.
CODE:
<div class="grid">
<?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 ORDER BY id DESC limit 18";
$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
}
?>
</div>
<!-- BOTÃO CARREGAR MAIS-->
<div id="rend-more">
<button class="button bt1" style="width: 262px; height: 50px; border: 1px solid rgb(84, 128, 128); position: relative; top: 30%; left: 50%; transform: translateX(-50%); cursor: pointer; background-color: white;">
<h2 style="text-align: center;color:#4d8984;font-family: 'Gotham-Thin';float: left;font-size: 25px;padding-left: 30px;padding-top: 5px;">CARREGAR</h2>
<h3 style="padding-left: 5px;float: left;font-size: 25px;color:#4d8984;font-family: 'gotham-bold';padding-top: 5px;">+</h3></button>
</div>