Consider the following simple PHP code:
<?php
$db=new mysqli('localhost', 'root','','apeirosto');
$query="UPDATE REQUESTS SET STATUS=1 where requestid=155";
$result=$db->query($query);
if (!($result)) {
$message= "fail_update";
echo $message;
}
else
{
$message= "success";
echo $message;
}
?>
My secondary question:
$result=$db->query($query);
plays the role of commit in DB?
My main question:
even if there is no row with PK requestid=155, $result returns true and the message I get is "success"... Why? How may I get an error message in such cases?
Thank you