So I read here : Why doesn't MySQL support millisecond / microsecond precision? that from the version 5.6.4, the datetime format should take until milliseconds.
But it doesn't work for me even for deciseconds it doesn't take. When I do my "INSERT" query, the value saved looks like this "2014-09-15 15:05:54".
The value I wanted to insert look like this : "2014-09-15T15:05:54.0" So when I do comparaison, I get errors :/
Here is my INSERT Query :
$bdd->query('INSERT INTO ev
(id_event, ts, sp, lg, dir)
VALUES
(NULL,"'.$evTs.'","'.$ev_sp.'","'.$ev_lg.'","'.$ev_dir.'")');
Where "$evTs" is the timestamp.
Update 1
How I create my table ev :
'CREATE TABLE `ev` (
`id_event` int(32) NOT NULL AUTO_INCREMENT,
`ts` datetime NOT NULL,
`sp` int(32) NOT NULL,
`lg` int(32) NOT NULL,
`dir` int(32) NOT NULL,
`nbr_voie` int(32) NOT NULL,
PRIMARY KEY (`id_event`)
)