[wp-trac] [WordPress Trac] #44163: wpdb->update() fails, showing no error message

WordPress Trac noreply at wordpress.org
Mon May 21 09:08:25 UTC 2018


#44163: wpdb->update() fails, showing no error message
-------------------------------+------------------------------
 Reporter:  tazotodua          |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Database           |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by subrataemfluence):

 * keywords:   => reporter-feedback


Comment:

 Your insert code is:
 {{{#!php
 <?php
 $wpdb->insert("example_table", array("name" => "James", "id"=>"123",
 "data"=>"blabla") );
 }}}


 and Update code is:
 {{{#!php
 <?php
 $wpdb->update("example_table", array("name"=>"Jonathan"),
 array("id"=>"133") );
 }}}


 Not sure if you have used different `id` intentionally in insert and
 update. I think it should be 123!

 {{{#!php
 <?php
 $wpdb->update("example_table", array("name"=>"Jonathan"),
 array("id"=>"123") );
 }}}


 I tested with the following and worked perfectly for me.

 {{{#!php
 <?php
 $wpdb->insert("example_table", array("name" => "James", "id"=>"135",
 "data"=>"blabla") );
 $wpdb->update("example_table", array("name"=>"Subrata"),
 array("id"=>"135") );
 }}}

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


More information about the wp-trac mailing list