Answer the question
In order to leave comments, you need to log in
The query removes two rows instead of one. What is the reason?
Greetings. Tell me what could be the problem?
$mysqli = new mysqli ("localhost", "mysql", "mysql", "dbname");
$mysqli->query ("SET NAMES 'utf8'");
$query = $mysqli->query("SELECT `id`, `country1`, `country2`, `id_country` FROM countries");
$data = $query->fetch_assoc();
$del = $mysqli->query("DELETE FROM `countries` WHERE `id` = '$data[id]'");
$del = $mysqli->query("DELETE FROM `countries` LIMIT 1'");
Answer the question
In order to leave comments, you need to log in
I suspect the requests go by the GET method and there is no favicon.ico file (some browsers ask for it by default for the tab), it turns out there are two requests that delete records in turn. In phpmyadmin, actions go by the POST method, so there is no problem even if you delete this file
Check with the browser inspector what requests go to the page with this code
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question