Quantcast
Channel: MySQL Forums - MySQL Workbench
Viewing all articles
Browse latest Browse all 3724

date formatting for MySQL datetime column (no replies)

$
0
0
(Sorry - this doesn't belong here. I've reposted the same question in a more apropriate area. (I couldn't figure out how to move this instance.))

I found this in the doc for date() ...

$today = date("Y-m-d H:i:s"); // 2001-03-10 17:16:18 (the MySQL DATETIME format)

So I used this for my insert query ...

$query = "insert into Author_Records (Auth_First_Name, Auth_Last_Name, Auth_Date_Added) values
('FirstName', 'LastName',date('Y-m-d H:i:s'))";

The error message I get is ...

Incorrect datetime value: 'Y-m-d H:i:s'

What dumb noob error did I make?

Thanks, Bob

Viewing all articles
Browse latest Browse all 3724

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>