Skip to content

Declaration of ADODB_db2::_query(&$sql, $inputarr = false) not compatible

Problem


PHP Fatal error: Declaration of ADODB_db2::_query(&$sql, $inputarr = false) must be compatible with ADOConnection::_query($sql, $inputarr = false)

Solution


If you are using ADOdb 5.22.6 there is a bug that broke the DB2 driver.  It was also reported by user, and 5.22.6 was the only version that was effected. 


Fortunately it is a very easy fix, just need to remove & in function _query() in line 1571 in adodb/adodb-php/drivers/adodb-db2.inc.php. 

From 
function _query(&$sql,$inputarr=false)

To
function _query($sql,$inputarr=false)
It's likely the official fix will be released in 5.22.7. 

Feedback and Knowledge Base