Title: WPDB Update methods
Last modified: August 20, 2016

---

# WPDB Update methods

 *  [igdesigners](https://wordpress.org/support/users/igdesigners/)
 * (@igdesigners)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/wpdb-update-methods/)
 * Okay, I’ve been fooling arround with my plugin and ended up in a very upsetting
   situation.
    I’m creating a form that expects the user to update the content. 
   But if no changes were made and the submit button is hit (like many users do 
   actually), than the if statement that cheks if the update is made, throws an 
   error, `$wpdb->because` update sais 0 rows were actually updated.
 * So… any ideas to work arround that? I would love to be able to tell the users
   that there is no error, but they just didn’t made any changes to submit without
   crosschecking submited values and the values in the table…
 * And on a sidenote: Wouldn’t it be easier to make update return 0 if an error 
   occurs 1 if successful and 2 if there was no actual update (data is the same).
   This will allow mutch more precise diagnostics of what happened exactly…
 * Thanks in advance.

The topic ‘WPDB Update methods’ is closed to new replies.

## Tags

 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)
 * [wpdb](https://wordpress.org/support/topic-tag/wpdb/)

 * 0 replies
 * 1 participant
 * Last reply from: [igdesigners](https://wordpress.org/support/users/igdesigners/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/wpdb-update-methods/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
