I'm doing a simple PHP code to delete database email, but I need to use if
and else
if a given action occurs.
If, for example, deleting an email displays a certain message, or if it does not have the requested email in the database, a message appears that is no longer present in the table following the code.
<?php
$emailDel = $_POST['delemail'];
$dbc = mysqli_connect('localhost', 'xavier', 'xavier', 'store_database')or die('não foi possivel acessar Banco de Dados');
$query = "DELETE FROM clients WHERE email = '$emailDel'";
$result = mysqli_query($dbc, $query)or die('não foi possivel acessar Banco de Dados');
if($result = TRUE){
echo $emailDel.' as deleting from database';
}else{
echo $emailDel.' it is not present in database';
}
mysqli_close($dbc);
?>