KoolReport's Forum

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

Demi Report from MySql Table #2502

Open tele programador opened this topic on on Dec 17, 2021 - 1 comments

tele programador commented on Dec 17, 2021

Hi forum

I just tested Sales By Customer Report Demo from Orders.csv demo file and everything was Ok

Then I migrated Orders.csv data to a MySql table and change php code to "SalesByCustomer_mysql.php" and then got the following php error message

Fatal error: Uncaught Error: Call to undefined method mysqli_stmt::get_result() in in /srv/.../koolreport/core/src/datasources/MySQLDataSource.php on line 395

Some internet search suggests the php server doesn´t have mysqlnd activated

I asked info() to server and it said:

  • MySQL is not installed
  • MySQLi is installed
  • libmysqlclient driver is being used

Using this code:

echo "<p>";
if (function_exists('mysql_connect')) {
    echo "- MySQL is installed";
} else  {
    echo "- MySQL is not installed";
}

echo "<p>";
if (function_exists('mysqli_connect')) {
    echo "- MySQLi is installed";
} else {
    echo "- MySQLi is not installed";
}

echo "<p>";
if (function_exists('mysqli_get_client_stats')) {
    echo "- MySQLnd driver is being used";
} else {
    echo "- libmysqlclient driver is being used";
}

echo "<p>";
// $salesByCustomer = new SalesByCustomer_mysql;

My question is: Is there any alternative to read MySql table data with this php configuration

Thank you in advance AR

KoolReport commented on Dec 18, 2021

Could you please use the default PDODataSource. It is default connection so you don't need to specify the "class" inside report datasource settings. Here is example. Basically here is the sample report settings:

    function settings()
    {
        return array(
            "dataSources"=>array(
                "sakila_rental"=>array(
                    "connectionString"=>"mysql:host=localhost;dbname=sakila",
                    "username"=>"root",
                    "password"=>"",
                    "charset"=>"utf8"
                ),
            )
        ); 
    }   

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
None yet

None