You seemed to have solved everything but the issue with the time:
found the issue %d should be %s. but I see that it saves the server
time not the current timezone
WordPress has a number of date/time related functions. In this case, it sounds like what you need is current_time()
, which…
Returns the blog’s current local time in one of two formats, either
MySQL’s timestamp data type format (i.e. YYYY-MM-DD HH:MM:SS) or the
Unix timestamp format (i.e. epoch).
So what you should need is:
$wpdb->update(
'mytable',
array(
'value' => 'hello world',
'edit' => current_time( 'mysql' )
),
array(
'option_name' => 'the row'
),
array('%s, %s')
);
Related Posts:
- SELECT rows between two datetimes when the range is dynamic [closed]
- Get error messages when $wpdb->insert() returns false?
- Detecting errors generated by $wpdb->get_results()
- Does dbDelta delete columns as well?
- How to get the post publish date outside the loop?
- How to fetch Data in WordPress using MySQLi or $wpdb
- WordPress Unit Testing – Cannot Create Tables
- Does wpdb add considerable overhead on queries with large result sets?
- Why does $wpdb return strings for mysql integer values?
- $wpdb->prepare() warning in WordPress 3.5
- Inserting data into custom tables
- Display data from a non wordpress database on a page template
- How might I retrieve a featured post image from an external WP site and display it as a link back?
- Export wordpress table to excel
- How to close wpdb connection? [duplicate]
- Inserting Post Meta From SQL
- Why does dbDelta() not catch MysqlErrors?
- Connecting to external oracle database
- Can’t save ajax value to database
- What causes the “max_user_connections” warning on WordPress frontend?
- $wpdb variable throw this error Call to a member function get_results() on a non-object in
- Updating all rows of table with $wpdb
- Safe way to find last inserted id in a table?
- Is $wpdb->prepare escaping to much? How to use it properly?
- Database slowdown after update to 3.4.1
- Remove database entries where post_date > expiration date
- Get data from database using $WPDB
- Getting all the users who have author privilege
- Multiple postmeta with same name for one post in wp_postmeta table
- WP Database Table to CSV file
- Cannot update custom database table row
- In what part of the WordPress core does the users table and usermeta table get joined?
- Modify Database in Multi-Site wp_usermeta table
- Advanced SELECT query with condtional statements
- $wpdb doesn’t like to store arrays
- Select two sums with single get_var statement
- WordPress choose wrong database
- Redirecting to old domain after migration website
- Create table from array with prepare
- Does WordPress $wpdb functions wait when table is locked?
- How Can I Put Meta_Compare in the Database-Query?
- WordPress running SQL query to update database from form
- I’m not able to get access to $wpdb [duplicate]
- WPDB SQL query with prepare() returning variable, not db value
- $wpdb error (Call to a member function insert() on a non-object)
- Is it important to have integers inserted using %d rather than %s?
- Problem in using wpdb
- How to fetch records from database WordPress
- Best practice to limit results in get_row()?
- Best practice to import user base (subscribers) from one website to another?
- AJAX wp-mysql running too slow
- Bulk Updating Post Date in 1 day Increments
- Clear Terms from Taxonomy for Specific Post IDs?
- Trouble running $wpdb->query() with last_insert_id
- Connecting to a different database
- Using $wpdb | checking entered email against existing emails in db
- Query Column of Specific ID from Database Table
- How to delete a particular row in a database table
- How to create more than one new wpdb object?
- Optimizing function that automatically creates internal links based on post title string
- Update multiple rows in one query
- How to connect and insert data in database of wordpress?
- Get results from wordpress data custom table
- Should I use an additional column in the DB?
- Outputting query results
- access JSON results from wordpress database with wpdb
- Getting value from database table depending on field value
- add_post_meta — not working
- Select From wpdb – Author/User Directory page
- wpdb->insert not inserting first variable
- How do I have a user upload a blog post and then retrieve that to display in a card on the site?
- $wpdb->insert not inserting all rows
- wpdb Insert unknown post data dynamic foreach loop
- How do I get database rows from a custom table using wpdb?
- Insert NULL value using prepare()
- Removing old_slug and old_date from WordPress Database
- Help with $wpdb on custom code
- “BS_” rows in postmeta table
- $wpdb->insert duplicating rows
- How to rerieve comments and their replies from DB
- Can I use a wpdb object to connect to a non-WordPress Oracle database [duplicate]
- Help posting values to DB on submit using $wpdb->query
- WordPress Database Query works in phpMyAdmin but not in the code
- 2 $wpdb queries causing error Table ‘wp_postmeta’ is specified twice, both as a target for ‘UPDATE’
- Correct and secure way to access a custom SQL database in a custom PHP template file
- Using $wpdb to insert data into a table
- How To connect to the same WordPress database with different database user
- Accessing content from third party as native posts in WordPress
- Call to a member function insert()
- I have include wp-config, should I add global $wpdb also?
- Processing a lot of $wpdb isn’t insert all the data
- Can’t Install WordPress (local) Failed to open file wp-includes/wp-db.php
- Pulling values from a sepcific row in table
- Creating Tables in WordPress Database
- Inserting into data into external DB using WPDB
- Insert Extra fields added in the front end registration form to DB
- How to use remote db tables in current config? [duplicate]
- $wpdb->insert not working for last select option
- $wpdb->prepare returns empty array
- Uploading to WordPress Database