Answer the question
In order to leave comments, you need to log in
Can't delete data from SQL DB. where is the mistake?
<div class="adm1">Удаление учащегося по телефону</div>
<form action="" method="post">
<input class="adm2" type="text" name="tel1" placeholder="Телефон">
<input class="adm2" id='btn' type="submit" value="Удалить">
</form>
<?php
if (isset($_POST['tel1']))
{
$tel = $_POST["tel1"];
$mysqli = new mysqli($db_host,$db_user,$db_password,$db_base);
$result = mysqli_query($mysqli, "DELETE FROM mytable2 WHERE tel = $tel");
echo "<script>window.location.href='index10.php'</script>";
}
Answer the question
In order to leave comments, you need to log in
after $result = mysqli_query($mysqli, "DELETE FROM mytable2 WHERE tel = $tel");
write if (!$result) die(mysqli_error($mysqli));
MySQL will tell you what's wrong
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question