[wp-trac] [WordPress Trac] #15158: wpdb insert & update with null values

WordPress Trac noreply at wordpress.org
Mon Sep 4 09:43:42 UTC 2017


#15158: wpdb insert & update with null values
----------------------------------+---------------------
 Reporter:  westi                 |       Owner:  pento
     Type:  enhancement           |      Status:  closed
 Priority:  normal                |   Milestone:  4.4
Component:  Database              |     Version:  3.0.1
 Severity:  normal                |  Resolution:  fixed
 Keywords:  has-patch needs-docs  |     Focuses:
----------------------------------+---------------------

Comment (by mikelast):

 Hello,
 Thanks for implementing this - just for clarification more than anything
 else is the following now considered correct

 {{{#!php
 <?php
 $wpdb->update($ttable, [
                         'user_id' => NULL,
                         'status' => 'available',
                         'update_time' => $now->format('Y-m-d H:i:s')
                 ], [
                         'therapist_id' => $therapist_id,
                         'user_id' => $user_id,
                         'start_time' => $ub['start_time']
                 ], [
                         NULL,
                         '%s',
                         '%s'
                 ], [
                         '%d',
                         '%d',
                         '%s'
                 ]);
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/15158#comment:46>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list