简体   繁体   English

我的SQL查询有什么问题?

[英]What's wrong with my sql query?

INSERT INTO jos_race_calendrier_regional (id, evt_code, evt_date_comp, evt_station, evt_activite, evt_comite, evt_club_num, evt_club_nom, evt_nom, evt_dt, org_nom, org_adresse, org_adresse2, org_adresse3, org_ville, org_site, cont_nom, cont_tel, cont_gsm, cont_fax, cont_mail, epr_codex, epr_date, epr_sexe, epr_regroupement, epr_grille_categorie, epr_categorie, epr_discipline, epr_distance, epr_homologation') VALUES ( '79', 'evt_code', 'evt_date_comp', 'evt_station', 'evt_activite', 'evt_comite', 'evt_club_num', 'evt_club_nom', 'evt_nom', 'evt_dt', 'org_nom', 'org_adresse1', 'org_adresse2', 'org_adresse3', 'org_ville', 'org_site', 'cont_nom', 'cont_tel', 'cont_gsm', 'cont_fax', 'cont_mail', 'epr_codex', 'epr_date', 'epr_sexe', 'epr_regroupement', 'epr_grille_categorie', 'epr_categorie', 'epr_discipline', 'epr_distance_style', 'epr_homologation')

i am getting following error 我收到以下错误

#1064 - You have an error in your SQL syntax; #1064-您的SQL语法有误; check the manual that corresponds to your MySQL server version for the right syntax to use near '') VALUES ( '79', 'evt_code', 'evt_date_comp', 'evt_station', 'evt_activite', 'e' at line 1 检查与您的MySQL服务器版本相对应的手册以在'')附近使用正确的语法VALUES('79','evt_code','evt_date_comp','evt_station','evt_activite','e'在第1行

The error message has already told you where your syntax error is (near), so you should look at your code again to find out what's wrong yourself, but I'll just pinpoint it to the very character for you now. 该错误消息已经告诉您语法错误在哪里(附近),因此您应该再次查看代码以找出自己的问题所在,但是现在我只为您确定字符的正确性。

You have a misplaced single quote here: 您在此处的单引号放错了位置:

epr_homologation') VALUES

Should be 应该

epr_homologation) VALUES

epr_homologation之后的额外报价:

INSERT INTO jos_race_calendrier_regional (id, evt_code, evt_date_comp, evt_station, evt_activite, evt_comite, evt_club_num, evt_club_nom, evt_nom, evt_dt, org_nom, org_adresse, org_adresse2, org_adresse3, org_ville, org_site, cont_nom, cont_tel, cont_gsm, cont_fax, cont_mail, epr_codex, epr_date, epr_sexe, epr_regroupement, epr_grille_categorie, epr_categorie, epr_discipline, epr_distance, epr_homologation) VALUES ( '79', 'evt_code', 'evt_date_comp', 'evt_station', 'evt_activite', 'evt_comite', 'evt_club_num', 'evt_club_nom', 'evt_nom', 'evt_dt', 'org_nom', 'org_adresse1', 'org_adresse2', 'org_adresse3', 'org_ville', 'org_site', 'cont_nom', 'cont_tel', 'cont_gsm', 'cont_fax', 'cont_mail', 'epr_codex', 'epr_date', 'epr_sexe', 'epr_regroupement', 'epr_grille_categorie', 'epr_categorie', 'epr_discipline', 'epr_distance_style', 'epr_homologation')

另外,如果'id'是一个整数,则不要在其周围加上''

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM