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.www.ads-software.com/ticket/15158
– https://www.ads-software.com/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.