1 -- 模糊搜索只是搜索标题 2 $sql = "select count(*) as sum from publish where pub_title like ‘%{$keyword}%‘ or pub_content like ‘%{$keyword}%‘"; 3 4 -- 模糊搜索搜索标题和内容 5 $sql = "select * from publish left join user on pub_owner = user_name where pub_title like ‘%{$keyword}%‘ or pub_content like ‘%{$keyword}%‘ order by pub_time desc limit $offset, $rowsPerPage";
原文:http://www.cnblogs.com/mrszhou/p/7529915.html