我在两个页面中传递了个字符串,写了个 String query = "select * from tb_news where title='"+txt+"'"; 为什么查询不到,如果直接写 "select * from tb_news where title='hi'"就能查询到title为hi的条目,为什么换成变量之后就查不到了呢,是我写错了吗?
...全文
1256打赏收藏
JSP如何写带变量的查询语句
我在两个页面中传递了个字符串,写了个 String query = "select * from tb_news where title='"+txt+"'"; 为什么查询不到,如果直接写 "select * from tb_news where title='hi'"就能查询到title为hi的条目,为什么换成变量之后就查不到了呢,是我写错了吗?