KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.

Mysqli bind_param() expected to be a reference, value given #1489

Open APS opened this topic on on Jun 18 - 9 comments

APS commented on Jun 18

Hi, I've got this error in the response when i try to type a search string on Datatables with Serverside.

DataTables::create(array(
...
"options"=>array(
		 "paging"=>true,
		 "pageLength" => 25,
		 "searching"=>true,
),
"method"=>'post',
"showFooter"=>true,
"serverSide"=>true,
...

Can you help me ? Thanks

KoolReport commented on Jun 19

Could you please send us more code. Especially the code related to serverSide setup like query.

APS commented on Jun 19

It's a very simple query :

DataTables::create(array(
	'name' => 'departements',
	'dataSource' => function() {
		return $this->src('geodata')
		->query("SELECT code, name FROM departements ORDER BY name");
	},

Thanks,

APS commented on Jun 24

Up,

And a precision about the error : "Parameter 2 to mysqli_stmt::bind_param() expected to be a reference, value given" on line 340 of .../koolreport/core/src/datasources/MySQLDataSource.php

Thanks

David Winterburn commented on Jun 24

We will test this and check if this is a bug with MySQLDataSource. In the meantime you could try to use PDODataSource to see if it works for you. Thanks!

APS commented on Jun 24

It works with PDODataSource...

David Winterburn commented on Jun 25

Would you mind telling us which version of PHP your web server is using as well? Thanks!

David Winterburn commented on Jun 25

In another test, please open the file koolreport/core/src/datasource/MySQLDataSource.php and replace the following line:

    call_user_func_array(array($stmt, 'bind_param'), [$typeStr] + $params);

with this:

    $stmt->bind_param($typeStr, ...array_values($params)); //spread operator ... only available since PHP 5.6

Then try DataTables' serverSide with MySQLDataSource again. Thanks!

APS commented on Jun 25

PHP Version : 7.2

Ok, i will try to replace the line... Will you fix this in the next release ?

Thanks

David Winterburn commented on Jun 25

On our test server using PHP 7.2 we haven't been able to replicate your error so it's a difficult problem to know where it went wrong in the first place. Let us know if my previous post fixes your problem. Thanks!

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