Title: $wpdb-&gt;update problem
Last modified: August 31, 2016

---

# $wpdb->update problem

 *  [bobchatelle](https://wordpress.org/support/users/bobchatelle/)
 * (@bobchatelle)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/wpdb-update-problem/)
 * I have the following code:
 *  echo “$this->zipcode $key Calling Update”;
    $wpdb>show_errors(); $wpdb->update(‘
   ncrj_donors’, array(‘zipcode=>$this->zipcode’), array(‘donorkey=>$key’)) or die(“
   Update Failed”); echo “Update called”;
 * When it’s executed this is what I get on the screen:
 * 02119-1582 Chatelle*******Robert****02119 Calling Update
 * The second echo statement is never executed. So the code doesn’t return from 
   $wpdb->update
 * There is nothing at all in the php error file.
 * I’m baffled.

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [neotechnomad](https://wordpress.org/support/users/neotechnomad/)
 * (@neotechnomad)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/wpdb-update-problem/#post-6980832)
 * Perhaps `$wpdb>show_errors();` should be `$wpdb->show_errors();` ?
 *  Thread Starter [bobchatelle](https://wordpress.org/support/users/bobchatelle/)
 * (@bobchatelle)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/wpdb-update-problem/#post-6980908)
 * I put the show_errors in there only for convenience. I look at the actual php
   error log and it has nothing in it.
 * But you’re right there is a typo. Which should have, I think, resulted in a parse
   error.
 *  Thread Starter [bobchatelle](https://wordpress.org/support/users/bobchatelle/)
 * (@bobchatelle)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/wpdb-update-problem/#post-6980909)
 * I corrected the typo, ran again, and got identical results. I’ve tried the code
   using both php 5.4 and php 5.6.
 * The requested update, by the way, does not occur.
 * The mystery is why is there no return from the call and why do no errors show
   up on the log.
 *  [neotechnomad](https://wordpress.org/support/users/neotechnomad/)
 * (@neotechnomad)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/wpdb-update-problem/#post-6981104)
 * Is this the entire code?
 *     ```
       echo "$this->zipcode $key Calling Update";
       $wpdb>show_errors();
       $wpdb->update('ncrj_donors', array('zipcode=>$this->zipcode'), array('donorkey=>$key')) or die("Update Failed");
       echo "Update called";
       ```
   
 * And, are you running this on-line or on your on computer?
 *  Thread Starter [bobchatelle](https://wordpress.org/support/users/bobchatelle/)
 * (@bobchatelle)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/wpdb-update-problem/#post-6981106)
 * My apologies for not getting back to this query. I had meant to, but ended up
   fighting other fires.
 * Stupid mistake on my part. This code is part of a php routine that is outside
   of wordpress. Thus $wpdb is meaningless.
 *  [neotechnomad](https://wordpress.org/support/users/neotechnomad/)
 * (@neotechnomad)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/wpdb-update-problem/#post-6981110)
 * Perhaps not… [Using wpdb, the WordPress database, outside of WordPress](http://www.stormyfrog.com/using-wpdb-outside-wordpress/)
   and [[resolved] Using $wpdb outside wordpress (19 posts)](https://wordpress.org/support/topic/using-wpdb-outside-wordpress?replies=19).
   
   Also Google “wordpress using $wpdb outside of”
 *  Thread Starter [bobchatelle](https://wordpress.org/support/users/bobchatelle/)
 * (@bobchatelle)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/wpdb-update-problem/#post-6981111)
 * Thanks for the link! I will check it out.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘$wpdb->update problem’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 2 participants
 * Last reply from: [bobchatelle](https://wordpress.org/support/users/bobchatelle/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/wpdb-update-problem/#post-6981111)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
