mysql - how to do a full text search with php pdo? -
so i'm having trouble current search website. current search achieve this; user inputs "crik" , return "cricket" search. if user inputs "crickets" wont return "cricket" search. how work? current php code is;
$searchq = $_get['search']; $ssss = $pdo->prepare('select * listing name :search'); $ssss->bindvalue(':search', "%" . $searchq . "%"); $ssss->execute();
i've tried didnt return anything;
$ssss = $pdo->prepare('select * listing match(name) against (:search in boolean mode) ');
you can change search string
$searchq = $_get['search']; $searcharr = str_split($searchq ); $searchq_new = ""; foreach($searcharr $alpha) { $searchq_new .= $alpha . "%"; }
now can use code search $searchq_new
Comments
Post a Comment