I would like to modify the default filtering condition to use an escape character. Using php connector with a pdo database connection. On looking at the logs the filtering is
I would like this to be
Im sure it can be done using the beforeFilter event … but I cant figure out from the docs.
function custom_filter($filter_by){
$index = $filter_by->index("PARM_NAM");
if ($index!==false) //there is client side input for the filter
$filter_by->rules[$index]["value"]= some_custom_processing($filter_by->rules[$index]["value"]);
}
$conn->event->attach("beforeFilter","custom_filter");
Sorry, I didn’t get it from the original question
You can use the similar code
function custom_filter($filter_by){
$index = $filter_by->index(“PARM_NAM”);
if ($index!==false) { //there is client side input for the filter
$value = $filter_by->rules[$index][“value”];
$name = $filter_by->rules[$index][“name”];
$filter_by->rules[$index] = " $name LIKE ‘$value’ escape ‘’ ";
}
}
$conn->event->attach(“beforeFilter”,“custom_filter”);
Which will set custom sql code for the filter in question
Not sure will it work for you or not, as you need the similar code added after LIMIT in the first query. If you good with PHP - you can subclass MySQLDBDataWrapper and override query method with logic to add extra code for each sql query ( and use your new DB type name as parameter of scheduler to use you custom db class instead of the original one )