I have two inputs date which is to get the date it receives from them and do a search on db to show all the products purchased during that date, but it gives the following error:
Fatal error: Uncaught Error: Call to undefined function mysqli_result() in C:\xampp\htdocs\ComFiltro\config\filtro.php:15 Stack trace: #0 C:\xampp\htdocs\ComFiltro\home.php(74): include() #1 {main} thrown in C:\xampp\htdocs\ComFiltro\config\filtro.php on line 15
Here is the input html:
<div class="main">
<h1 class="center port-1 page-header">Portal Guido</h1>
<!-- -->
<div class="jumbotron jumb-1">
<h4 class="center">Informe a data desejada para a busca dos produtos</h4><br>
<form class="form-inline text-center" method="">
<div class="form-group">
<label for="datainicial">Data inicial</label>
<input type="date" class="form-control" id="inicio" name="inicio" placeholder="Data de inicio">
</div>
<!-- -->
<div class="form-group">
<label for="datafinal">Data final</label>
<input type="date" class="form-control" id="fim" name="fim" placeholder="Data final">
</div>
<!-- -->
<button type="submit" id="filtro" name="filtro" value="filtro" class="btn btn-primary">
Buscar
</button>
<?php
include "config/filtro.php";
?>
</form>
</div>
</div> <!--MAIN -->
Here's the code for how to get the data and trying to pull in db:
<?php
require_once "config/conexao.php";
if (isset($_REQUEST['filtro'])) {
$inicio = $_REQUEST['inicio'];
$fim = $_REQUEST['fim'];
$query = "SELECT * from api_teste WHERE DATEV BETWEEN date('$inicio') AND date('$fim')";
$querySelect = mysqli_query($conn,$query);
if(mysqli_result($querySelect) == true){
$mensagem = "<div class='alert alert-danger'>Há!</div>";
printf ($mensagem);
}else {
$mensagem = "<div class='alert alert-danger'>Por favor coloque uma data válida!</div>";
printf ($mensagem);
}
}
?>
CONNECTION CODE:
<?php
$conn = new mysqli("localhost", "", "", "");
if ($conn->connect_error) {
die("Falha ao conectar!, Motivo: " . $conn->connect_error);
}
Does anyone know why it's not working and how to fix it? No db or DATEV is set to date