2013年8月26日 星期一

mysql-insert-date

INSERT INTO custorder VALUES ('Kevin', 'yes' , STR_TO_DATE('1-01-2012', '%d-%m-%Y') ) ;

But you can always use dates without STR_TO_DATE() function, just use the (Y-m-d) '20120101' or '2012-01-01' format. Check the MySQL docs: Date and Time Literals

INSERT INTO custorder VALUES ('Kevin', 'yes', '2012-01-01') ;

沒有留言:

張貼留言