The problems that I present are the following, since I am trying that when I search for something it shows me what I am looking for but if it does not find anything then it shows a message of does not exist, the question is that it already shows me the message of exists , but it does not show me the one that does not exist
This is the code
<?php
include "mysqlcon.php";
$con = connect();
if(isset($_POST['opcion']) && isset($_POST['datos'])){
$opcion = $_POST['opcion'];
$datos = $_POST['datos'];
if ($opcion == 1) {
$consulta = "SELECT * FROM info WHERE cedula = $datos";
}
if($opcion == 2){
$consulta = "SELECT * FROM info WHERE telefono = $datos";
}
$resultado = mysqli_query($con, $consulta);
$contador = 0;
while ($misdatos = mysqli_fetch_assoc($resultado));
if (mysqli_num_rows($resultado)>0)
{
echo(" Exite registro");
} else {
echo("No Existen registros");
}
}
?>
What I am omitting or where my error is.
Thanks for the help !!!