create table show
(id int primary key,
name varchar(50) not null,
money double not null,
explain varchar(50) not null,
img varchar(20) not null
);
 实在没查出错误 提示错误如下
ERROR 1064(42000): 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 'show 
(id int primary key,
name varchar(50) not null,
money double not null,
expl' at line 1

解决方案 »

  1.   

     create table `show`
    (id int primary key,
    name varchar(50) not null,
    money double not null,
    explain varchar(50) not null,
    img varchar(20) not null
    );注意SHOW应该是保留字。加上反引号
      

  2.   

    create table `show`
    (id int primary key,
    name varchar(50) not null,
    money double not null,
    `explain` varchar(50) not null,
    img varchar(20) not null
    );
    explain 也是mysql中的保留字。需要转义。建议你还是不要用保留字命名。因为你的后续操作都需要转义。
      

  3.   

    create table `show`
    (id int primary key,
    name varchar(50) not null,
    money double not null,
    `explain` varchar(50) not null,
    img varchar(20) not null
    );各种关键字 呵呵
      

  4.   

     把‘show’改为s ‘explain’改为expl貌似可以了