CREATE TABLE t_user
( id int AUTO_INCREMENT not null primary key ,
account char ,
password varchar(20) ,
type int ,
name varchar(30) ,
sex char ,
college varchar ,
teacher char,
);
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 '
teacher char
)' at line 8
出现这个错误,不知道哪里出了问题。
( id int AUTO_INCREMENT not null primary key ,
account char ,
password varchar(20) ,
type int ,
name varchar(30) ,
sex char ,
college varchar ,
teacher char,
);
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 '
teacher char
)' at line 8
出现这个错误,不知道哪里出了问题。
account char ,
password varchar(20) ,
type int ,
name varchar(30) ,
sex char ,
college varchar ,
teacher char
);多了个逗号 teacher char,[align=center]==== 思想重于技巧 ====
[/align]
varchar 没有默认。
如果不出错的话CREATE TABLE t_user
( id int AUTO_INCREMENT not null primary key ,
account char,
`password` varchar(20) ,
`type` int,
`name` varchar(30),
sex char ,
college varchar(255),
teacher char
);