Hi,
I want to understand how i can use WHERE IN condition with $_GET parameter.
As in above screen shot there is a possibility to define our own GET param with condition operators such as ( = , > < )… But i need condition WHERE IN
As in above screen i am trying to put ( in ) . But it isn’t working.
Can u tell me anything ?
Regards
Hi,
it’s hard to tell what exactly isn’t working without any kind of reproducible demo or logs.
First thing, you may want to enable connector logging:
$scheduler = new schedulerConnector($res, $dbtype);
$scheduler->enable_log("log.txt");
log.txt
will contain the exact sql queries connector generates, so you’ll be able to see sql created from your configuration.
Working code might look like the following:
$scheduler = new schedulerConnector($res, $dbtype);
$scheduler->enable_log("log.txt");
function custom_filter($filter_by){
$filter_by->add("event_id", $_GET["ids"], "IN");
}
$scheduler->event->attach("beforeFilter","custom_filter");
$scheduler->render_table("events","event_id","start_date,end_date,event_name,details");
And request from the client:
scheduler.load("events.php?ids=(66, 67, 68)");
Here are complete examples with “LIKE” and “IN” operators:
https://files.dhtmlx.com/30d/bdd7808e097b133d61f16282c2b8bf01/connector-filter-like-sample.zip
https://files.dhtmlx.com/30d/3f7bd2a35be8e12f0a65310a4f53cda4/connector-filter-in-sample.zip
Hi… Thanks for the solution.
Regards