Closed drshiki closed 8 years ago
@touchEngine What's the type of column time
? From your code, column time
assigned to null
, which I don't think it would make sense. You probably should define column time
like this:
create table t_data(time datetime not null default current_timestamp);
@lasteye my time
col definition is
| time | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
I have solved this problem, I reboot my computer and run this code correctly, this issue was led by background process which runs the previous version my test code, I never know python interpreter can run the file which people are modifing, it is not the issue of MySQLdb but of my code, and thx for your reply
it is my code for inserting data:
it is the inserted items in my database:
look at the last column, it is not 1800 seconds interval in tow records, and look at the _row 2 col 6_, it also inserted wrong, this col name is
altitude
however insert the value of colpressure
, though it insert the right value most time. and the print statements always execute correctly with right value and 1800 seconds interval. I checked my code over last night but not found any, what is wrong?