I have this search method that doesn't seem to work, and I am not sure why. I need an extra pair of eyes to see why my search query brings back false results. Thanks in advance.
public function search($data) {
$person = $data['person'];
$bind = [ ":person" => "%$person%" ];
$q = DB::inst()->query( "SELECT personID,fname,lname,uname
FROM
person
WHERE
(CONCAT(fname,' ',lname) LIKE :person
OR
CONCAT(lname,' ',fname) LIKE :person
OR
CONCAT(lname,', ',fname) LIKE :person)
OR
fname LIKE :person
OR
lname LIKE :person
OR
uname LIKE :person
OR
personID LIKE :person",
$bind
);
error_log(var_export($q,true));
foreach($q as $r) {
$array[] = $r;
}
return $array;
}