MySQL Forums
Forum List  »  General

Re: DATETIME does not keep fractional seconds (5.6.11)
Posted by: P THE AWESOME
Date: December 29, 2013 11:20AM

Alright:

CREATE TABLE `data1` (
`id` int(11) NOT NULL,
`datetime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`var1` float NOT NULL,
`var2` float NOT NULL,
`var3` float NOT NULL,
`var4` float NOT NULL,
`var5` float NOT NULL,
`var6` float NOT NULL,
`status_1` int(11) NOT NULL DEFAULT '1',
`status_2` int(11) NOT NULL DEFAULT '1',
`status_3` int(11) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8

Yes, I have been using `s to escape the satus columns. I also only have the DEFAULT CURRENT_TIMESTAMP in case there is an error in my program. I almost always set it manually.

When I run:
INSERT INTO `alldata`.`data1` (`id`, `datetime`, `var1`, `var2`, `var3`, `var4`, `var5`, `var6`, `status_1`, `status_2`, `status_3`) VALUES ('1', '2013-12-11 06:24:37.811999', '1.2', '4.5', '7.8', '9.1', '3.5', '6.7', '1', '2', '3');

I get: "1 row inserted." There are no errors. The output in phpMyAdmin: http://s17.postimg.org/8c44j2gfz/php_My_Admin_datetime_row.png and the output in the workbench http://s30.postimg.org/c0igizigh/workbench_datetime_row.jpg (I know it says SELECT, but I did try inserting the row there too).

Thanks!

Options: ReplyQuote


Subject
Written By
Posted
Re: DATETIME does not keep fractional seconds (5.6.11)
December 29, 2013 11:20AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.