注册 登录
编程论坛 JavaScript论坛

小白一只,请各位大佬赐教~~

是心愿 发布于 2017-07-09 10:37, 2077 次点击
try {  
               
                dbc=new DBConnect();
                String sql = "INSERT INTO b_order(username,product,buynum,address,phonenum) VALUES(?,?,?,?,?)";  
               
                Order order=new Order();
                String name=username;
                String bproduct=product;
                int bnum=buynum;
                String addr=address;
                int bphone=phonenum;
               

报错
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 'order (username,type,buynum,address,phonenum) VALUES('qq','qq',1,'qq',1)' at line 1

百度到的说是关键字问题,但是好像并不是,还请大佬赐教啊~~
1 回复
#2
林月儿2017-07-10 16:40
INSERT INTO b_order(username,product,buynum,address,phonenum) VALUES(?,?,?,?,?)
order (username,type,buynum,address,phonenum) VALUES('qq','qq',1,'qq',1)


请问这两个是同一个表吗?
如果存在这个表名为order的表,就测测这个报错信息中的sql,分析正确的该怎么改。
1