使用Mysql插入语句时出错

时间:2012-04-08 08:45:24

标签: mysql

执行以下语句时,我收到以下错误

INSERT INTO upcoming_matches(
    Id, Date, me_date, Match, team1, team2, 
    Timing, Status, series_id, 
    match_place,series_mtch_type, match_live,match_result, MINI_LINK, 
    PHOTOS_URL, scorecard_ID) 
VALUES(
    764, '2012/03/11', '2012/03/11', 'Bangla vs Pak', '2', '6', 
    '08:00 GMT | 14:00 local 13:30 IST', 1, 171, 
    'Shere Bangla National Stadium, Mirpur', 'ODI', 1, '', '1483',  
    'http://www.cricandcric.com/photo-gallery/', 3258)
GO

[Error] Script lines: 1-5 --------------------------
 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Match, team1, team2, Timing, Status, series_id, match_place,
 series_mtch_type, ' at line 1 

 Warnings: ---> 
   W (1): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Match, team1, team2, Timing, Status, series_id, match_place,
 series_mtch_type, ' at line 1
          <--- 

任何人都可以帮我解决这个问题

2 个答案:

答案 0 :(得分:1)

matchreserved mysql keyword,您需要用反引号将其括起来

`match`

答案 1 :(得分:1)

您不必在MySQL中使用GO关键字关闭该语句,您必须使用分号;

关闭它

您还必须在任何可能包含保留的keywork或大写字段的字段名称周围添加反引号。