I have here my php code so that you can delete the client, but only delete it when you write the client name (which is in the html). but I do not know how to make the condition if someone writes a name of a client that is not in the database. And I also do not understand when I enter a name atoa it the same as the deleted client message: /, does not else
<script language="javascript">
<!--
function myFunction(a) {
alert(a);
}
</script>
<?php
ini_set ('default_charset','utf-8');
$link = mysqli_connect("localhost", "root", "", "bd_calcadocharme");
$id=$_GET['id'];
$sql="DELETE FROM encomenda WHERE id='$id'";
$result = mysqli_query($link,$sql);
if ($result){
echo "<script> myFunction('Cliente eliminado com sucesso'); </script>";
header('refresh:0 ; url=pedir_rese.html'); }
else{
echo "<script> myFunction('Erro ao tentar eliminar o registo na base de dados!'); </script>";
header('refresh:0 ; url=pedir_rese.html');
}
?>