KoolReport's Forum

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

ERROR--Call to a member function execute() on boolean. #1089

Closed iRiyada opened this topic on on Sep 18, 2019 - 7 comments

iRiyada commented on Sep 18, 2019

I have a project up and running using koolreport. Now I tried to upgrade to its version4 and run, it shows the following error."call to a member function execute() on boolean", This error is coming only in those reports, where there is parameter binding to the query. What could be wrong?

KoolReport commented on Sep 18, 2019

Could you please post the query and the binding, I would like to have a look

iRiyada commented on Sep 18, 2019

In my report there is a datatable which is filtered using (1)daterange (2)select input the select input is posing the error. 1)daterange input is binded with :start, :end input 2)select input is binded with :supervisionName This is the query in filename.php

select s.name 'Supervision Name',
            p.name        'Work Type',
            count(1)      'Task Count'
        from tablec c, tablepr p, tablesu s where
            c.project_id = p.id and
            p.project_type = s.code and
            p.project_type in (1, 2, 3, 4, 5) and
            c.istype = 1
           and c.dt_created between :start and :end 
           ".(($this->params["الوحدةالإدارية"]!=array())?"and s.name in :supervisionName":"")."   
           $sql 
        group by s.name, p.name
        ORDER BY s.code, p.id")->params(array( ":start"=>$this->params["min"],
                ":end"=>$this->params["max"],":supervisionName"=>$this->params["الوحدةالإدارية"]))
            ->pipe($this->dataStore('user_details'));



Here only this parameter is causing the error.

            $this->params["الوحدةالإدارية"]

Without this input , it seems to be working . In all reports the select input binding is causing problem. This is my select input in filename.view.php `

select2::create(array(

                "multiple"=>true,
                "name"=>"الوحدةالإدارية",
                "placeholder"=>"اختر ",
                "dataStore"=>$this->src("mysql")->query("select distinct name FROM tables $sql"),
                "attributes"=>array(
                    "class"=>"form-control"
                ),

            ));
Please check for the mistake
KoolReport commented on Sep 18, 2019

Just change in :supervisionName to in (:supervisionName) and let me know if it works.

iRiyada commented on Sep 18, 2019

Thank you very much. It worked.

KoolReport commented on Sep 18, 2019

We are also sorry for the change which costs your sometime. Previously PDODataSource does not use () and other datasources use (). We want to keep only one standard for all datasources so there is no change in sql statement if we switch to another datasource. So we were in front of the choice whether with or without (). At the end we reason that the () indicated the variable inside needs to be array and will resulting in less type error. That's why we decided to make this change.

iRiyada commented on Sep 18, 2019

Oh. okay. My input was an array. Now I get it..

Since you were prompt in replying, it did'nt take much of my time.. Hats off Team koolreport for the timely support always..Keep the good work going

KoolReport commented on Sep 18, 2019

Thank you very much!! Anything please let us know.

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
solved

None