Mysqli query LIKE

$search_text = '%'.$_GET['search_text'].'%';

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


search 用百分比把物件包起來,再到LIKE 用引號 ' ' 把變數包起來。
Please follow and like us:
Pin Share

發表迴響