Answer the question
In order to leave comments, you need to log in
How to specify id with autoincrement type in sql query?
Hello
, id is int(10) autoincrement unsigned
When adding a comment to a table with id = 2, everything is ok
INSERT INTO `product_comments`(`id`, `product_slug`, `product_id`, `user_id`, `created_at`, `updated_at`, `content`) VALUES (2,'крем-для-рук-и-ногтей',1,2,'2019-04-08 13:25:31.000000','2019-04-08 13:25:31.000000','Крем вообще супер.')
INSERT INTO `product_comments`(`id`, `product_slug`, `product_id`, `user_id`, `created_at`, `updated_at`, `content`) VALUES ( ,'крем-для-рук-и-ногтей',1,2,'2019-04-08 13:25:31.000000','2019-04-08 13:25:31.000000','Крем вообще супер.')
INSERT INTO `product_comments`(`id`, `product_slug`, `product_id`, `user_id`, `created_at`, `updated_at`, `content`) VALUES ('', 'крем-для-рук-и-ногтей',1,2,'2019-04-08 13:25:31.000000','2019-04-08 13:25:31.000000','Крем вообще супер.')
Answer the question
In order to leave comments, you need to log in
Remove id from request, autoincrement will be added automatically
INSERT INTO `product_comments` (`product_slug`, `product_id`, `user_id`, `created_at`, `updated_at`, `content`) VALUES ('крем-для-рук-и-ногтей',1,2,'2019-04-08 13:25:31.000000','2019-04-08 13:25:31.000000','Крем вообще супер.')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question