Create table with AUTO_INCREMENT and TIMESTAMP:

CREATE TABLE temperatura_new (
id INT NOT NULL AUTO_INCREMENT,
tempdegree VARCHAR(20),
insert_date TIMESTAMP,
PRIMARY KEY (id)
);

Insert test data:

INSERT INTO temperatura_new (tempdegree) VALUES ( '32');
INSERT INTO temperatura_new (tempdegree) VALUES ( '34');
select * from temperatura_new;

+----+------------+---------------------+
| id | tempdegree | insert_date         |
+----+------------+---------------------+
|  1 | 32         | 2014-02-03 10:08:51 |
|  2 | 34         | 2014-02-03 10:08:57 |
+----+------------+---------------------+

 

Comments powered by CComment