From the codex:
<?php $wpdb->update( $table, $data, $where, $format = null, $where_format = null ); ?>
In your exampe ‘ CURDATE()’ is simply a string, not a MySQL function (or something else).
The correct syntax for php’s date() is:
date( [format], [timestamp] )
Try this:
$this->wpdb->update(
'wp_competitors',
array(
'results' => $tips, // json
'update_time' => date( 'Y-m-d H:i:s', time() )
),
array( 'token' => $token ),
array(
'%s', // value1
'%d' // value2
),
array( '%d' )
);
Better than php’s date() is WordPress current_time():
current_time( 'mysql' )
This will return something similiar to 2012-12-02 23:00:08
Related Posts:
- Show a different number of posts per page depending on context (e.g., homepage, search, archive)
- Is their any way to Extend WPDB class and Overwrite the Default Query Function
- Using nextGen Gallery.. how can I call a list of all Gallery Names?
- Search and replace text across all posts
- bulk post_content update
- [Plugin: Posts 2 Posts] How does it work?
- Post query – show posts from specified day and month and whole years
- Plugin echos text from shortcode function in gutenberg page editor
- WP Query. Is there a maximum size?
- WordPress and a secondary database?
- plugin code is pulling information from database in one instance and not in other. What is wrong?
- WooCommerce search products between price range using WP_Query
- correct validate and sql query
- correct sql query
- SQL query, error
- Create a post builder skin in a plugin
- Taxonomy Drill-Down / Plugin Help – hierarchical queries within plugin?
- How to customize a title by passing query string?
- What is the best way to cache pages on WordPress
- Always get creating a new table with foreign key
- problem with sql query
- add_query_arg not work in admin
- How to return the values from a row where a value occurs for the first time among the rows available?
- How to use apply_filters?
- How to search post titles with whole words only, but not the exact word only?
- Change language on website and change currency with url query
- Displaying different content depending on variable
- How to create algorithm for ordering posts in WordPress?
- Multiple Meta key in search
- Having trouble going from Jfiddle to implementing in WordPress :(
- Proper way to trigger a MySQL query via link in a plugin
- get_var result empty for query of custom table in plugin admin
- WP-Snap too slow (caused by WP_Query?)
- Using wp config to connect to a DB from a plugin
- ‘Active lotteries’ only custom query for woocommerce lottery plugin and elementor
- Remove posts that start with similar words (like a delete duplicate posts plugin)
- how to create child WordPress plugin
- How do I replace a function, declared inside a plugin’s class, in functions.php?
- What are the best practices for updating?
- TinyMCE Advanced newline problem
- Plugins or Tutorials for displaying data from SQL-db on WP-page? [closed]
- How to test a WordPress plugin through the upgrade automatically feature
- How can I list only sites that use a particular theme or plugin?
- Disabled plugins are security holes – rumor or reality?
- Failed to invoke other hook from the init hook
- Reblog from Tumblr to WordPress
- Plugin for Sending Email to Readers about New Posts? (besides “Subscribe2 “)
- Is it possible to remove this action? (as it’s added just before it’s called)
- There’s some way to add a wrapper around posted images?
- Advanced Integration – WordPress + YOURLS
- Redirect all blog links from WordPress.com site to new domain
- wp_enqueue_script fails to include in footer
- How to show popup to a group of users?
- Limit the number of plugins that can be installed in a WordPress installation
- How to Sort the Favorite Plugins Screen Alphabetically?
- First WordPress Plugin – Stat Issues
- MySql database help for a plugin
- Adding an Options Page to a Plugin
- How do I “get the next 10 posts after post_id == x”?
- How to Delete all Unused photos Function
- WordPress.org Plugin Directory doesn’t recognise screenshots [closed]
- How to check current user before all actions and filters?
- WP Plugin for onpage link suggestions [closed]
- Customizing NEXTGEN Gallery To link images to pages
- Why am I getting a “Call to undefined function curl_init()” when I try to use the Sociable plugin?
- Is there a social members only login plugin for WordPress? [closed]
- rewrite_rules() not applying rules on plugin activation only after permalinks menu is clicked
- Private Page View Counter
- Get all the URLs of the pages that uses a specific shortcode
- Pagination shows Same posts
- Extending a theme: build new features as plugin or core modules?
- How to auto strip hyperlinks & images in wordpress post
- How can I temporarily remove content from all pages, but leave up URL?
- How to modify the Loop from a plugin (instead of a theme)
- help intercepting save_post through plugin
- best way to run a php script away from the template?
- Limiting title characters in the AZIndex plugin
- How to show posts as custom field in specific post type?
- Prevent WordPress from sending set-cookie http header
- Use AJAX to fetch Current Post Thumbnail for WordPress when Uploaded throughMedia Uploader Frontend
- How to add post title to custom php?
- How to Disable Auto Executing Script in A Particular Page Only
- Looking for Image Slider that is based on default WP Media Library
- Replace Yoast og:image in single custom post type
- How to change the deafult template in WordPress plugin
- How to save the option’s new values plus old value without overwrite old one
- Display post to another website
- catch urls with specific pattern and show specific content for them by plugin
- Get a Taxonomy values in an array
- Place content inside the Post Loop
- Is there any wordpress function to update a random post every 10 minutes?
- Getting error “The package could not be installed. PCLZIP_ERR_BAD_FORMAT ”
- Not your usual Class ‘Memcached’ not found error
- wp_insert_post_data filter to set category
- Please Check this ‘.htaccess’ File
- Text Wrapping in WPDataTables
- how to show selected options drop down menu values in attributes field in after saving post.php
- Buffered output in chunks and shortcode – how do I achieve that?
- Schedule WordPress plugin activation and / or deactivation on a custom date and time, how to do?
- What forum plugin can I use to allow non-registered users to create posts and comment? [closed]