Mysqli query LIKE

分享至
$search_text = '%'.$_GET['search_text'].'%';

$rs = $mysqli->query("SELECT * FROM `user` WHERE $search_category LIKE '$search_text'");


search 用百分比把物件包起來,再到LIKE 用引號 ' ' 把變數包起來。

發表迴響