0
I was unable to get this code to return a message stating that it did not locate the requested data, I need to fix it and the other doubt is that even without putting anything in the search field if I press the send button it returns the first items of the database, I don’t know how to fix it.
<?php
$servidor = "-";
$usuario = "-";
$senha = "";
$database = "-";
//Criar a conexao
$conn = mysqli_connect($servidor, $usuario, $senha, $database);
$pesquisar = $_POST['pesquisa'];
$sql = "SELECT * FROM `jazigos` WHERE `NOME` LIKE '%{$pesquisar}%' LIMIT 1";
$resultado_cemiterio = mysqli_query ($conn,$sql);
while($rows_sql = mysqli_fetch_array($resultado_cemiterio, MYSQLI_ASSOC)){
echo "<b>Nome do Falecido</b>: ". $rows_sql["NOME"] ."<br>";
echo "<b>Data de Nascimento</b>: ". $rows_sql["DATA DE NASCIMENTO"] ."<br>";
echo "<b>Data de Falecimento</b>: ". $rows_sql["DATA DE FALECIMENTO"] ."<br>";
echo "<b>Quadra</b>: 0". $rows_sql["QUADRA"] ."<br>";
echo "<b>Jazigo</b>: ". $rows_sql["JAZIGO"] ."<br>";
echo "<b>Gaveta</b>: 0". $rows_sql["GAVETA"] ."<hr>";
}
?>
I’ll test that code
– Kadu Silva
worked out this, and in the case of the boot that even with the blank search field, it shows the first items of the database
– Kadu Silva
@Kadusilva edited the answer
– Pedro Augusto
our face worked super well, now I will see how to make pagination,because my database has 5 thousand item and as and name of people, several times appears the same name on the same page and gets very large
– Kadu Silva
Behold
datatables
, is good! https://datatables.net/– Pedro Augusto
And mark my answer as valid. :)
– Pedro Augusto
you know how to make pagination?
– Kadu Silva