Return value of mysql_affected_rows
$ Result = mysql_query ("update user set sex = '{$ _ clean ['sex']}', face = '{_ _ clean ['face']}', qq = '{$ _ clean ['QQ']}', email = '{$ _ clean ['mail']}', url = '{$ _ clean ['URL']}' where username = '{$ _ COOKIE ['username']}' ", $ conn );
Why is the returned value of mysql_affected_rows () 0 and the execution result correct? is it true that the number of affected rows is not returned in principle?
You cannot use the value of $ result to determine whether the result is successful.
Reply to discussion (solution)
Mysql_affected_rows returns 0, indicating that no record is modified.
However, the update command is correct.
But the result is indeed modified!
But I didn't see you execute mysql_affected_rows.
Sorry, it was my own mistake. when I wrote data to the database in the early stage, I accidentally had two usernames with the same values. so I was not careful that mysql_affected_rows () was 2!