Title: wpdb update null
Last modified: August 21, 2016

---

# wpdb update null

 *  [234pm](https://wordpress.org/support/users/joshuajjsmithyahoocom/)
 * (@joshuajjsmithyahoocom)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/wpdb-update-null/)
 * Hi,
 * I found that using wpdb->update to set a db field to null is not working. I did
   some research and found the following info:
 * – [https://core.trac.wordpress.org/ticket/15158](https://core.trac.wordpress.org/ticket/15158)
 * – [http://wordpress.org/support/topic/bug-fix-wpdb-insert-amp-update-with-null-values?replies=7](http://wordpress.org/support/topic/bug-fix-wpdb-insert-amp-update-with-null-values?replies=7)
 * Given the info in the ticket, it looks like it’s still a bug, even in the current
   version of wordpress.
 * An example of what I want to do is:
 *     ```
       $c1 = "";
       $c2 = NULL;
       $wpdb->update(
       	'table',
       	array(
       		'column1' => $c1,	// string
       		'column2' => $c2	// integer (number)
       	),
       	array( 'ID' => 1 ),
       	array(
       		'%s',	// value1
       		'%d'	// value2
       	),
       	array( '%d' )
       );
       ```
   
 * Note – the db columns do allow NULL.
 * Is this still not possible?
 * Thanks.

The topic ‘wpdb update null’ is closed to new replies.

## Tags

 * [$wpdb-&gt;update](https://wordpress.org/support/topic-tag/wpdb-gtupdate/)
 * [NULL](https://wordpress.org/support/topic-tag/null/)
 * [wpdb](https://wordpress.org/support/topic-tag/wpdb/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [234pm](https://wordpress.org/support/users/joshuajjsmithyahoocom/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/wpdb-update-null/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
