Let\'s say you have a form with pre-populated data from your database, and you allow your users to make changes and save the form. If the user clicks the save button without mak
[affected_rows()][1] is -1 if a query fails, not zero. [1]: http://www.php.net/manual/en/function.mysql-affected-rows.php
[affected_rows()][1] is -1 if a query fails, not zero.
[1]: http://www.php.net/manual/en/function.mysql-affected-rows.php
It may return 0 if no changes were made to the row (same values), or if mysql didnt find a row to update. It will only return -1 due syntax erro