I have a form that passes query data and an external PHP file called busca.php
My problem is that I do not get any php error to know the problem that it does not find the filter search. When I use the normal search it returns me all the values of the bank.
What's happening? Here is the program code, where q
is to receive the consulta
text field of a consulta.php
file:
if(isset($_POST['buscar'])){
$q = $con->real_escape_string($_POST['consulta']);
$query_Busca = "SELECT * FROM equipamento WHERE tombamento LIKE '%$q%'";
$Busca = mysqli_query($con,$query_Busca) or die($con->error);
// Check results
if($Busca){
//Se for um sucesso!
$row_Busca = mysqli_fetch_assoc($Busca);
$totalRows_Busca = $Busca->num_rows;
}
In this else
the function is working normal giving all the data of the bank as I wish the problem is even in the code above where I want to find the equipment only by the number of tipping that is in "consultation" yet he does not think and not me returns error.
} else {
$query = "SELECT * FROM equipamento";
$Busca = $con->query($query) or die($con->error);
$row_Busca = mysqli_fetch_assoc($Busca);
$totalRows_Busca = $Busca->num_rows;
}