我试图将记录添加到MySQL表中,但我一直收到语法错误。
INSERT INTO `lwljhb_lwl_matches` (id, league_seasons_id, schedule_id, playoff_round, scheduled_week_number, date_played, winner_id, loser_id, forfeit, forfeit_reason, match_begin_time, match_end_time)
VALUES (,14,,0,1,2018-04-15,52,87,0,,'14:55:00','17:41:00');
id列是自动递增的,match_begin_time和match_end_time字段是TIME。 任何人都可以指出我的愚蠢错误吗?
答案 0 :(得分:1)
您必须为所有列指定某些内容。
INSERT INTO `lwljhb_lwl_matches` (id, ...)
VALUES (NULL, ...)
答案 1 :(得分:0)
如果列中没有数据,则必须放置null
,除非该列不能为空。这是你正确的政治家
INSERT INTO `lwljhb_lwl_matches` (id, league_seasons_id, schedule_id, playoff_round, scheduled_week_number, date_played, winner_id, loser_id, forfeit, forfeit_reason, match_begin_time, match_end_time) VALUES (null,14,null,0,1,2018-04-15,52,87,0,null,'14:55:00','17:41:00');