MySQL遇到经典例子--(遇到就写)
时间:2021-07-01 10:21:17
帮助过:2人阅读
-- 模糊搜索只是搜索标题
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";
MySQL遇到经典例子--(遇到就写)
标签:content from 搜索 情况 div use 例子 style rom