wpdb update add current timestamp not working

Question

So using the $wpdb->update to add some data to a custom table, trying to add the current timestamp but it’s not saving the right stuff(0000-00-00 00:00:00 this is saved).

overview code

  $wpdb->update('mytable',
      array(
          'value' => 'hello world', 
          'edit'  => date("Y-m-d h:i:s") //saves 0000-00-00 00:00:00
      ),
      array(
          'option_name' => 'the row'
      ), 
      array('%s, %s')
  );
0
, , user759235 6 months 0 Answers 76 views 0

Leave an answer