>[info] 核心要點:匹配
% 表示任意數量的任意字符(其中包括0個)
_ 表示任意單個字符

多個關鍵詞的搜索,多個關鍵詞可以以 空格或逗號隔開
```
1,查詢用戶名以某個字符開頭的用戶
select * from where username like 'a%'; ------ 注意,默認情況下不區分大小寫
select * from where username REGEXP '^a';
2,查詢用戶名以某個字符結尾的用戶
select * from where username like '%a';
3,查詢用戶名包含某個字符的用戶
select * from where username like '%a%';
4,查詢用戶名長度為3的用戶
select * from where username like '___';
select * from where username REGEXP '^...$';
5,查詢用戶名第二個字符為o的用戶
select * from where username like '_o%';
讓查詢的結果中高亮搜索的關鍵詞
$row['username'] = str_replace( $keywords , '<font color="red"'.$keywords.'</font>',$row['username'] ) ;
```
fulltext全文索引
1. mysql使用全文搜索功能,數據表引擎必須是MyISAM
2. mysql全文搜索功能不支持中文,可將中文特殊處理