-3
People help me please I already looked everything and researched about it but nothing worked i have a table with id, name, phone and display this table through the Ajax request because I use a search system without refresh
$(document).ready(function(){
$.ajax({
url: 'exibir.php',
method: 'POST',
data:'metodo=LISTAR_ARQUIVOS',
beforeSend:function(){
},
success: function(resultado){
$(".result").html(resultado);
}
});
});
and would like to add a limit paging system
$select = $pdo->prepare("SELECT * FROM clientes LIMIT $inicio, $quantidade");
however if I use a normal php pagination system does not work
follows below the view.php that Ajax query, without the traditional php pagination
<?php
require('action/conexao.php');
$metodo = $_POST['metodo'];
switch($metodo){
case 'LISTAR_ARQUIVOS':
$pdo = Conexao::getInstance();
$stmt = $pdo->prepare("SELECT * FROM clientes");
$stmt->execute();
if($stmt->rowCount() >=1){
while($row = $stmt->fetch(PDO::FETCH_ASSOC)):
echo
"<tr>
<td id='test'>". $row['nome'] ."</td>
<td>". $row['telefone'] ."</td>
";
?>
<td>
<ul class="actions">
<li><a href="" id="<?php echo $row['id'];?>" class="ative btnUpdate"><i class="fas fa-check"></i> Atualizar</a></li><!--
--><li><a href="" class="cancel"><i class="far fa-eye"></i> Ver</a></li><!--
--><li><a href="action/cnl.php?id=<?php echo $row['id'];?>" class="cancel"><i class="fas fa-times"></i> Cancel</a></li><!---->
</ul>
</td>
<?php
endwhile;
echo "</tr>";
?>
<?php
}else{
echo ('Nenhuma pedido encontrado.');
}
break;
}
?>
Important you [Dit] your question and explain objectively and punctually the difficulty found, accompanied by a [mcve] of the problem and attempt to solve. To better enjoy the site, understand and avoid closures and negativities worth reading the Stack Overflow Survival Guide in English.
– Bacco