为什么一模一样的SQL语句,在mysql里执行成功,嵌入到网页里就失败呢?
mysql里执行:createviewview_filter_resultasselect*fromrvm_phoneinfowherephone_idin(select...
mysql里执行:
create view view_filter_result as select * from rvm_phoneinfo where phone_id in
(select A.phone_id from rvm_filter_brand A
left join rvm_filter_price B on B.phone_id = A.phone_id
left join rvm_filter_facade C on C.phone_id = A.phone_id
left join rvm_filter_system D on D.phone_id = A.phone_id
where brand='Nokia' and price='NL' and facade='NL' and system='NL');
嵌入到网页里的语句是:
String createView = "create view view_filter_result as select * from rvm_phoneinfo where phone_id in "
+"(select A.phone_id from rvm_filter_brand A"
+"left join rvm_filter_price B on B.phone_id = A.phone_id"
+"left join rvm_filter_facade C on C.phone_id = A.phone_id"
+"left join rvm_filter_system D on D.phone_id = A.phone_id"
+"where brand='"+brand+"' and price='"+price+"' and facade='"+facade+"' and system='"+system+"')";
我仅仅修改了where里的部分条件,为什么总是报错说我在where这里有语法错误呢?? 展开
create view view_filter_result as select * from rvm_phoneinfo where phone_id in
(select A.phone_id from rvm_filter_brand A
left join rvm_filter_price B on B.phone_id = A.phone_id
left join rvm_filter_facade C on C.phone_id = A.phone_id
left join rvm_filter_system D on D.phone_id = A.phone_id
where brand='Nokia' and price='NL' and facade='NL' and system='NL');
嵌入到网页里的语句是:
String createView = "create view view_filter_result as select * from rvm_phoneinfo where phone_id in "
+"(select A.phone_id from rvm_filter_brand A"
+"left join rvm_filter_price B on B.phone_id = A.phone_id"
+"left join rvm_filter_facade C on C.phone_id = A.phone_id"
+"left join rvm_filter_system D on D.phone_id = A.phone_id"
+"where brand='"+brand+"' and price='"+price+"' and facade='"+facade+"' and system='"+system+"')";
我仅仅修改了where里的部分条件,为什么总是报错说我在where这里有语法错误呢?? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询