First of all, I suggest you navigate through the problem. The php manual is rummaged over 1001 times to solve the problem.
I am Baidu, and there are a variety of answers from netizens.
First, correct Baidu's mistake:
Copy codeThe Code is as follows:
$ SQL = "update table a set aname = 'name' where aid = 88 ";
$ R = $ conn-> query ($ SQL );
If ($ r ){
Echo "indicates that the data is updated here. If the data with the aid of 88 does not exist, true is returned. ";
}
The where statement returns true even if the SQL statement is correct. The true statement can be interpreted as "no error" in the SQL statement, which has the same effect as the Write statement: $ conn-> query ($ SQL) or die ("An error occurred while updating. Check whether the parameters are correct. ");.
Use mysql_affected_rows ($ conn) or mysqli_affected_rows ($ conn) to obtain the updated rows)