mysql - SQL 语法错误 - 我的 SQL

标签 mysql

<分区>

ms_connect.query('INSERT INTO companies_codes VALUES (' + null + ',' + siteLoadWait + ',' + nextPageLoadWait + ',' + pagination + ',' + jsLoaded + ',' + pagesDefined + ',' + buttonLoading + ',' + singlePage + ',' + originAdding + ',' + addingSlashAfterOrigin + ',"' + nextPageButtonCode + '","' + jobsMetaCode + '","' + pagesMetaCode + '","' + pageJobsCode + '","' + jobsDetailsCode + '","' + buttonLoadingCode + '","' + undefinedPagesCode + '",' + refereceKey + ')', function(err, rows, fields) {
  if (err) {
    eventSameMess("database_error", err + " ");
  } else {
    eventSameMess("Database", "Data inserted Successfully into COMPANIES CODES table !");
  }
})

enter image description here

它显示以下错误:

Error: ER_PARSE_ERROR: 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 '0,1,0,0,0,1,1,"","","","","","","",34)' at line 1

SQL 查询:

INSERT INTO `companies_codes` (`id`, `site_load_wait`, `next_page_load_wait`, `pagination`, `js_loaded`, `pages_defined`, `button_loading`, `single_page`, `origin_adding`, `slash_in_origin`, `next_page_button_code`, `jobs_meta_code`, `pages_meta_code`, `page_jobs_data_code`, `jobs_details_code`, `button_loading_code`, `undefined_pages_code`, `comp_fk`) VALUES (NULL, '5000', '5000', '1', '1', '1', '1', '0', '0', '0', 'No', 'wait', 'found', 'here', 'mate', 'code', 'no code', '17');

最佳答案

您需要在语句中定义您的列,格式为

INSERT INTO tableName (columnName) VALUES (columnValue):

https://www.w3schools.com/nodejs/nodejs_mysql_insert.asp

关于mysql - SQL 语法错误 - 我的 SQL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51858313/

相关文章:

mysql - 解决sql文件第1274954 : Unknown command '\' ' in larger (100mb+) mysql .行处的错误

mysql - 我该如何纠正这个问题?

PHP/MYSQL 过期删除数据

mysql - 从 mysql 查询返回一个连接的字符串

php - 将 yii 默认用户名字段更改为电子邮件字段以进行登录

MySQL 没有充分利用服务器

python - 如何在 Mac OS 10.8 上安装 MySql-python-1.2.3

mysql - SQL数据库外键问题(INSERT语句与FOREIGN KEY约束冲突 "FK__Orders__Employee__0F624AF8"

php - 更改表将文本添加到非空值

mysql - phpmyadmin (mysql) 中列名的计数