Problem with a query when doing a WHERE with dates

0

I have a problem and that is that at the moment I do the where with the date I do not know why, even though there is something in the database with the same date to which I do not get anything, so it always enters the if.

The date of the variable that I use to compare the I bring by post from a form with an input type date.

$conexion=mysqli_connect("localhost", "root", "", "basereserva");
$query="SELECT * from mesas where dia=".$fecha;
$resultado=mysqli_query($conexion, $query);

if (mysqli_num_rows($resultado)>0){
    print("Exite al menos un registro");

} else {
    print("No Existen registros");



    }
    
asked by Joaquin 12.06.2018 в 00:31
source

0 answers