Hello, I'm looking for help because I'm having trouble creating a result page, I made a page that contains two search fields, "what to look for" and "where to search", it works and filters correct, but I'm not able to do paging to limit the search results, where am I going to be missing the following code?
$conexao =mysqli_connect($host,$user,$pass,$bank);
$pagina = (isset($_GET['pagina'])) ? $_GET['pagina'] : 1 ;
$consulta1 ="SELECT * FROM registro_clientes";
$qrTotal =mysqli_query($conexao,$consulta1) or die(mysqli_error());
$numTotal =mysqli_num_rows($qrTotal);
$quantidade = 2;
$totalPagina=ceil($numTotal/$quantidade);
$inicio = ($quantidade * $pagina) - $quantidade;
if(mysqli_connect_errno($conexao)){
echo "erro conect hen";
}else{
if(isset($_GET['buscar'])&& isset($_GET['onde'])){
$nome = $_GET['buscar'];
$bairro = $_GET['onde'];
$consulta = "SELECT * FROM registro_clientes
WHERE nome_cliente LIKE '%$nome%' AND bairro LIKE '%$bairro%'
ORDER BY preferencial ASC
LIMIT $inicio, $quantidade ";
$executar = mysqli_query($conexao,$consulta);
$total = mysqli_num_rows($executar);
echo "Encontrado ".$total. " resultado(s):";
echo "<br>";
echo "<hr>";
while ($ln=mysqli_fetch_array($executar))