KoolReport's Forum

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

PDO Error #2872

Open Andre Van Der Walt opened this topic on on Nov 14 - 5 comments

Andre Van Der Walt commented on Nov 14

Good day

I'm getting the following error using the dashboard package.

SQLSTATE[HY000]: General error: 2014 Cannot execute queries while there are pending result sets. Consider unsetting the previous PDOStatement or calling PDOStatement::closeCursor()

Is there a specific setting to fix this?

Sebastian Morales commented on Nov 16

Would you pls let us know your Dashboad and KoolReport Pro versions as well as your dashboard board/widget code that caused this error? Tks,

Andre Van Der Walt commented on Nov 16

Hi Sebastian

We are currently on 3.5.0 and 5.16.2 dashboard and pro versions respectively.

We get this on various reports so I'll only supply one example.

Below is the board:


namespace App\Reports\Report;

use App\Reports\Filters\DateRange;

use koolreport\dashboard\containers\Html;
use \koolreport\dashboard\Dashboard;
use \koolreport\dashboard\containers\Row;
use \koolreport\dashboard\containers\Panel;
use koolreport\dashboard\inputs\Dropdown;
use \koolreport\dashboard\widgets\Text;
use \koolreport\dashboard\inputs\Button;
use \koolreport\dashboard\Client;

class QAQuestionsAdherenceBoard extends Dashboard
    protected function widgets()
        return [
                return Client::dashboard("Board")->load();



Below is the report:


namespace App\Reports\Report;

use koolreport\dashboard\fields\Text;
use \koolreport\dashboard\widgets\KWidget;
use Illuminate\Support\Facades\DB;
use \App\Reports\AutoMaker;

class QAQuestionsAdherenceTable extends KWidget
    protected function dataSource()
        $dateRange = $this->sibling("DateRange")->value();

        return AutoMaker::rawSQL


    protected function onCreated()
                "fastRender" => true,
                "plugins" => ["Buttons"],
                    "order"=> [
                        [0, 'asc'],
                        [1, 'desc'],
                        "visible"=> true,
                    "responsive"=> true,
                    "autoWidth" => false,
                "showFooter" => true,
                    "table"=>"table table-hover table-grey",

    protected function fields()
        return [


    public function dataView()
        $dataView = parent::dataView();
        $fields = $this->fields();

        return $dataView
Andre Van Der Walt commented on Nov 16

Also, it does not only occur with Raw queries. We also get this with procedure calls.

Sebastian Morales commented on Nov 17

Would you pls download the latest koolreport/core version, which is free, and replace your current koolreport/core with it to see if this issue remains? Tks,

Andre Van Der Walt commented on Nov 17

Hi Sebastian

That seems to have fixed it.

Thank you.

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