like查询如何使用sql的安全预处理过滤?

浏览:2228 发布日期:2013/07/19 分类:求助交流
$keyword = 'test';
$sql = "select * from news where title like '%s' ";
$list = $this->query($sql, array($keyword));
这样可以,不过我需要like模糊查询,该如何添加%%呢?

$sql = "select * from news where title like '%%s%' ";
这样解析就有问题了,该如何写?
最佳答案
评论( 相关
后面还有条评论,点击查看>>