5
I have my php code here so you can delete the client, but only delete when you write the client name (which is in html). but I don’t know how to make the condition if someone writes a name of a client that isn’t in the database. And also I do not understand when I put a name to it same as the deleted account message :/ , does not make the LSE
<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');
}
?>