The problem is that you’re using 'M'
and 'D'
, which are a textual representations, MySQL is expecting a numeric representation of the format 2010-02-06 19:30:13
Try: date('Y-m-d H:i:s')
which uses the numeric equivalents.
edit: switched G
to H
, though it may not have impact, you probably want to use 24-hour format with leading 0s.
Related Posts:
- How to use mysqli_query() in PHP?
- PHP Connection failed: SQLSTATE[HY000] [2002] Connection refused
- PHP Connection failed: SQLSTATE[HY000] [2002] Connection refused
- PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP
- what does “/index.php?admin/admin_dashboard” in my url mean
- How can I prevent SQL injection in PHP?
- How to create a foreign key in phpmyadmin
- If variable equals value php [duplicate]
- MySQL – count total number of rows in php
- PHP Warning: mysqli_error(): Couldn’t fetch mysqli in
- Foreach only outputs if id is 0
- http://localhost:80 is not working on running Apache server through UniServer ZeroXIII
- “INSERT IGNORE” vs “INSERT … ON DUPLICATE KEY UPDATE”
- How to join two tables by multiple columns in SQL?
- SQL – Update multiple records in one query
- MySQL Error 1093 – Can’t specify target table for update in FROM clause
- mysqladmin: connect to server at ‘localhost’ failed
- mysql update multiple columns with same now()
- Usage of MySQL’s “IF EXISTS”
- SQLSTATE[HY093]: Invalid parameter number: parameter was not defined
- MAMP “Apache couldn’t be started because port is in use.” AND “Can’t connect to local MySQL server through /tmp/mysql.sock
- Getting java.sql.SQLException: Operation not allowed after ResultSet closed
- SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens on line 102
- ERROR: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it
- Deprecated: mysql_query() [duplicate]
- CAST to DECIMAL in MySQL
- How to stop mysqld
- Can I store images in MySQL
- MySQL Daemon Failed to Start – centos 6
- How to remove index.php from WordPress site URL
- How to use Memcached with PHP7?
- select count(*) from table of mysql in php
- Set page template for all pages?
- is it possible to run some php code within a wordpress page?
- Optimize Multiple Taxonomy Term MySQL Query?
- WordPress MySQL & PHP Performance
- What specific database privileges does WordPress need?
- Using source control with WordPress
- My WordPress site always displays a cached version of its homepage
- Updating User Meta with SQL Query
- wpdb prepare syntax
- Would manually deleting the dumping data fix a “#1062 – Duplicate entry ‘1’ for key ‘PRIMARY'” phpMyAdmin error?
- How to run this SQL query of wp_terms database
- Modern Tribe Calendar wp-query with meta query not working at all
- Proper way to work with wpdb to get user’s firstname
- How to change post format from Aside to Image for all posts?
- How to add and SQL query of posts only published
- Slow Mysql Queries
- can database and media folder be moved to a different drive?
- Find duplicate posts with same slug and author
- Is the outdated PHP mysql extension a requirement for WordPress 4.6?
- writing inner join in wpdb
- Why is variable not working on custom sql query using wpdb?
- How can I export posts with featured images, without download them
- Unknown collation when I import a dump from an existing site into a development database?
- PHP script can’t connect to Database on port 3307
- When WordPress Default table, Echo Success. When Plugin Table, Echo Blank
- WpDataTables – View Image Directory
- Sum the total amount of a specific product purchased per user and display in table
- How to translate this mySQL query to $wpdb query
- MySQL 5.5 upgrade ‘broke’ WordPress [closed]
- Separate DB by yearly archive of WordPress
- Update MySQL query so that it functions again
- Make a database query using WordPress
- Query posts by custom taxonomy and sort by post_modified
- WordPress $wpdb get posts from category and sort by custom meta
- Array Formation Issue
- Using wordpress function to retrieve data
- Migration problems with mysql: Operation not allowed when innodb_forced_recovery > 0 [closed]
- making php value numeric
- WordPress $wpdb no result
- How to get the custom field value using SQL query
- Please help! I have a problem with getting wordpress databas
- How to run complex query using PHP
- when using $wpdb sudden connection rejection without changing anything. Access denied, with errors from repair tool
- Conditional formatting on data fetched from MYSQL
- Can I split a huge wp_postmeta table across different databases or servers?
- edit_user_created_user hook – using to update Groups
- Mysql Error in querying form entries in Gravity Form plugin
- WP + MySql db / PHP
- The plugin generated 225 characters of unexpected output during activation
- append data to mysql table via submit button coded in php – not working
- WordPress select query issue
- Improving performance of SQL sub-queries in WordPress
- How to do a MySql query in WordPress?
- Send data from plugin to external database
- How to set max users to 17.000
- directorypress theme error mysql_error() [closed]
- Saving custom term value to the database in new table
- MySQL errors after a WordPress clone
- MYSQL Join on meta key value?
- Cannot Upload Custom Header Image into WordPress Dashboard
- Complicated MySQL Query
- problem with quotes on new post
- Predefine Magazine Style Layouts
- Parse error: syntax error, unexpected ‘}’ in C:\xampp\htdocs\admin\products.php on line 148 [closed]
- remove wordpress post links
- mysqldump to a tar.gz
- Where is my mysql log on OS X?
- running an existing WordPress site from Visual Studio Code?