The sql statement succeeded, but the number of rows changed to 0? ? ?

  ios, question
$ query = "updatetable _ usersetbalance = balance plus' $money' where name='$name'";
 $result=$mysqli->query($query);
 echo $result;
 echo "<br>";
 echo $mysqli->affected_rows;

The database has been successfully connected. After the above code is executedecho $resultAn output of 1 indicates that the operation was successful, butecho $mysqli->affected_rowsThe output is 0, which indicates failure. How did this happen? What is the problem? ? ? ?

Hint: If you execute a record update statement on mysql client first, you can continue the update in php and it will be successful. If you do not execute a record on mysql client, it will not be successful.

The success of the operation does not mean that you have changed anything. Can your sql inside where condition be matched? Also, make sure your $money is not 0

MySQL > updateyansetsexi _ id = sexi _ id plus 1 where id=1234342341;
 Query OK, 0 rows affected (0.00 sec)
 Rows matched: 0  Changed: 0  Warnings: 0
 
 mysql> update yanse set sexi_id=sexi_id where id=1;
 Query OK, 0 rows affected (0.00 sec)
 Rows matched: 1  Changed: 0  Warnings: 0

Both are query OK, but 0 rows affected.