I am trying to update the value of an entry in the gravity forms detail table.

I am simply trying to update the 'date' field inside of an entry. Here is my query:

        $update_date = $wpdb->update( 
                'value' => the_date('Y-m-d')
                'lead_id' => 170, 
                'field_number' => 16

It seems to be returning an error. This is the first time I am using $wpdb at all, so I may be doing something wrong here. Thanks!

  • try $wpdb->prefix . 'rg_lead_detail' for the table name May 4, 2014 at 15:49
  • 2
    "seems to be" or actually is returning an error. If returning an error what is that error?
    – s_ha_dum
    May 4, 2014 at 15:49

1 Answer 1


I'm not sure why you are using the the_date() function, but if you must, make sure it returns the value instead of echo-ing it.

So instead of this part:

     'value' => the_date('Y-m-d')

try this one:

    'value' => the_date( 'Y-m-d', $before = '', $after = '', $echo = 0 );

To catch the update error, check out this question: Showing errors with $wpdb update

In general also remember to activate WP_DEBUG on your test site: Debugging in wordPress.

  • @EHerman Any progress on this problem?
    – birgire
    May 7, 2014 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.