1
Guys I’m trying to make a charging system on demand and I don’t know anything about ajax and I don’t understand very well how it would work.
I have a posting system that shows an amount of 10 posts on my page, and when I click on my second page (paging) it shows over 10 and so on until I finish my bank post.
What I wanted is to make a system on demand "Press Button More" without having to go to another page.
My file showing my posts
<?php
$conexao = mysqli_connect("host", "jubileu", "1dois");
mysqli_select_db($conexexao,"nada");
$pagina = (isset($_GET['pagina']))? $_GET['pagina'] : 1;
$cmd = "SELECT * FROM Banco_opa ORDER BY id DESC";
$empresa = mysqli_query($conexexao,$cmd);
$total = mysqli_num_rows($empresa);
$registro = 10;
$numPaginas = ceil($total/$registro);
$inicio = ($registro*$pagina)-$registro;
$cmd = " SELECT * FROM Banco_opa ORDER BY id DESC LIMIT $inicio,$registro";
$empresa = mysqli_query($conexexao,$cmd);
$total = mysqli_num_rows($empresa);
while ($BancoID = mysqli_fetch_array($empresa)){echo'<div class="Post">'.$BancoID['ID'].'</div>';}
?>
If anyone can help me vlw ^^
You said you didn’t understand anything about Ajax, so I can try to help your understanding. Ajax is a schema to, on the client side, send a request to the server. This request is not synchronous, it can happen at any time and you need to wait for the server response. When the answer is obtained, the data obtained is processed and then some action is taken. For example, the action of putting more elements in the
div
with the posts– Jefferson Quesado