When I try to update mysql
from php
with the same value as the existing one in the data then affected_rows
returns zero.
Which means the database operation went successful anyway. So I want to return the successful message, irrespective of the same value as before. but based on the affected_rows
value I can't say anything. So in this situation how should i check that the operation was successful anyway?
The below will be an example case....
$query='update chapter set ChapterName=? where ChapterId=?';
$stmt=$mysqli->stmt_init();
$stmt->prepare($query);
$stmt-> bind_param('si', $chaptername, $chapterid);
$stmt->execute();
if($stmt->affected_rows>0)
{return true;}
EDIT I have removed the typos.. that was my mistake