PHP 7.4 PHP Deprecated: implode(): Passing glue string after array is deprecated. Swap the parameters in vendor/tommyknocker/pdo-database-class/PDODb.php on line 435
PHP 7.4 deprecated notice when inserting values using an array as the data source
The code:
$this->model->db->insert(
'roles',
[
'role'=>'editor',
'description'=>'Blog editor. Has access to blogs and blog posts.'
]
);
The error
PHP Deprecated: implode(): Passing glue string after array is deprecated. Swap the parameters in vendor/tommyknocker/pdo-database-class/PDODb.php on line 435
Replace this line with:
if (isset($dataColumns[0])) $this->query .= ' ('.implode(', ',$dataColumns).') ';
@bas-surlinio
Replace this line with: if (isset($dataColumns[0])) $this->query .= ' (
'.implode(',',$dataColumns).') ';
As in this?
L435:
if (isset($dataColumns[0])) $this->query .= ' (`\'.implode(\'`, `\'$dataColumns).\'`) ';
Correct
//if (isset($dataColumns[0])) $this->query .= ' (`'.implode($dataColumns, '`, `').'`) ';
if (isset($dataColumns[0])) $this->query .= ' (`' . implode('`, `', $dataColumns) . '`) ';
Will there be a release with this change?
Yeah, sure. Releazed v1.1.1 today