mysql java

来源:百度知道 编辑:UC知道 时间:2024/06/16 19:12:23
pid = 13
String sql = "select * from article where pid =" + id;
我在论坛上看到有人说上面sql 语句有错
错在何处?
谢谢

pid是int型还是String型都好用。
String sql = "select * from article where pid =' " + pid + " ' ";

错了你找我,QQ308689212

没错...
要错的话,
int pid=13;
String sql = "select * from article where pid =" + id;

sql没有错啊!
你也可以放在程序里面试一下啊!

String sql = "select * from article where pid =" + id;
最后的id前面加个字母p? ......