Unknown column 'shouye3' in 'where clause'

String sql = "select allow_pic,allow_text,allow_link,price from ad_module where alias= shouye3;

报出Unknown column 'shouye3' in 'where clause'的错误

原因是:alias是字符类型的数据,查找应该加上引号。改成

select allow_pic,allow_text,allow_link,price from ad_module where alias='shouye3'就不会报错了

posted on 2013-05-20 20:13  CaptainLuffy  阅读(177)  评论(0)    收藏  举报