I have a simple table in ClearDB:
CREATE TABLE `users` (
`id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(100) DEFAULT NULL,
`message` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=INNODB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
I'm using Node to insert data into the table via:
var post = {username: response.user.name, message: message.text};
connection.query("INSERT INTO users SET ?", post, function(err, rows, fields) {
if (err) {
console.log('error: ', err);
throw err;
}
});
However whenever I insert my id field increases by 10 rather than 1 (and it started off with 12:
id username message
12 test test
22 test test
32 test test
42 test test
Any idea why this is happening?
Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…