Aşağıdaki yöntemi kullanabilirsiniz
private function generateStringCondition($value = '',$field = '', $operator = '', $regex = '', $wildcardStart = '', $wildcardEnd = ''){
if($value != ''){
$where = " $field $regex '$wildcardStart".strtolower($value)."$wildcardEnd' ";
$searchArray = explode(' ', $value);
if(sizeof($searchArray) > 1){
foreach ($searchArray as $key=>$value){
$where .="$operator $field $regex '$wildcardStart".strtolower($value)."$wildcardEnd'";
}
}
}else{
$where = '';
}
return $where;
}
aşağıdaki gibi bu yöntemi kullanın
$where = $this->generateStringCondition($yourSearchString, 'LOWER(columnName)','or', 'like', '%', '%');
$sql = "select * from table $where";
BINARY