【问题标题】:#1064-you have an error in SQL syntax: check the manual that corresponds to your MySQL server version for the right syntax to use near ')#1064-您的 SQL 语法有错误:查看与您的 MySQL 服务器版本相对应的手册,以获取在 ') 附近使用的正确语法
【发布时间】:2021-08-06 09:41:24
【问题描述】:
create TABLE product
(
    productid int not null AUTO_INCREMENT,
    productname varchar(100) not null,
    productdesc varchar(100)not null,
    productrate double(100) not null,
    imagea varchar(100) not null,
    imageb varchar(100) not null,
    imagec varchar(100)  not null 
) type=MyISAM

these images contains query and the error displayed

【问题讨论】:

  • 你能发布有问题的实际查询吗?
  • 我给了一张图片看看那里。只需点击“图片包含查询和错误”。
  • 将 Type=MyISAM 更改为 Engine=MyISAM。
  • 我很确定您的 DOUBLE(100) 数据类型也无效......dev.mysql.com/doc/refman/8.0/en/floating-point-types.html
  • 我建议不要使用近似的 FLOAT/DOUBLE,而是使用精确的 DECIMAL。

标签: mysql sql phpmyadmin


【解决方案1】:
create TABLE product
(
    productid int not null AUTO_INCREMENT,
    productname varchar(100) not null,
    productdesc varchar(100)not null,
    productrate float(25) not null,
    imagea varchar(100) not null,
    imageb varchar(100) not null,
    imagec varchar(100)  not null,
    PRIMARY KEY(productid)
) ENGINE=MyISAM

谢谢克雷格,感谢大家回复我解决这个问题。

【讨论】:

    猜你喜欢
    • 2022-01-24
    • 2014-08-17
    • 1970-01-01
    • 2016-11-06
    • 1970-01-01
    • 2015-10-23
    • 2011-08-07
    相关资源
    最近更新 更多