I created this table (results) in my sql database (test)
CREATE DATABASE `test`;
USE `test`;
CREATE TABLE `results` (
`number` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`id_machine` int(10) unsigned NOT NULL,
`value` float NOT NULL,
`datetime` datetime NOT NULL,
PRIMARY KEY (`number`),
UNIQUE KEY `indice_UNIQUE` (`number`)
) ENGINE=InnoDB AUTO_INCREMENT=100;
I have the following results
8, 22.22, 42.56, 8.95, 3.64
I would like to save my data in my table in this way:
Number id_machine value datetime
101 8 22.22 2013-06-05 14:03:00
102 8 42.56 2013-06-05 14:03:00
103 8 8.95 2013-06-05 14:03:00
104 8 3.64 2013-06-05 14:03:00
Is there any easy way to do this query?
Something like
char query[]="INSERT INTO results(`id_machine`,`value`) VALUES(......)";