KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Select2 - Error when 2 or more filters selected #988

Open Frederic Begue opened this topic on on Jul 16, 2019 - 1 comments

Frederic Begue commented on Jul 16, 2019

Hi,

The report contain one DateRangePicker filter and 8 Select2 filters. When the DateRangePicker is selected with 2 or more Select2 filters having the following error:

PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens .

The report is very close to your example: https://www.koolreport.com/examples/reports/advanced/multiple_data_filters/ just added databBind as below, what could be the issue please?

Select2::create(array(
                "multiple"=>true,
                "name"=>"teams",
                "dataSource"=>$this->src("mydata")->query("
                            SELECT id, description
                            FROM  teams
                            WHERE is_active=1 OR deleted_at IS NULL
                            ORDER BY description ASC
                        "),
                "dataBind"=>array(
                    "text"=>"description",
                    "value"=>"id"
                ),
                "attributes"=>array(
                    "class"=>"form-control"
                ),
            ));
KoolReport commented on Jul 16, 2019

Do you use the params() somewhere to bind parameter to SQL statement?

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

None