sql语句中,传入的参数带单引号的问题
时间:2021-07-01 10:21:17
帮助过:14人阅读
if(cateName.indexOf("‘")!=-1
){
2 oql = " select * where name = ‘"+cateName.replace("‘", "‘‘")+"‘ "
;
3 }
else{
4 oql = " select * where name = ‘"+cateName+"‘ "
;
5 }
先对参数进行判断,当参数中含有单引号时,用"‘‘"替换单引号;
sql语句中,传入的参数带单引号的问题
标签:span style 遇到 lse class col where 判断 else