WordPress.org

Ready to get started?Download WordPress

Forums

WPDB Update methods (1 post)

  1. igdesigners
    Member
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic