result question on id that does not exist
Hi, i am working on my error control, and as a test i ran a url that simulated a delete action on a row id that
did not exist to make sure my error message is triggered properly.
I decided to test the value of result like this.
$query = "DELETE FROM users WHERE ID='$seldom' LIMIT 1";
$result = mysqli_query($myconnect,$query);
The value of result is 1 which i assume means true.
Question, how can result be true when the ID i submitted does not exist?
I wonder if mysqli_affected_rows would be a better choice.
This does seem to work
$jobdone = mysqli_affected_rows($myconnect);
if($jobdone > 0)
//query performed action
// val 0 no action
// -1 error
//query performed no action