PHP-MySQLi-Database-Class
PHP-MySQLi-Database-Class copied to clipboard
php 7.4 - Deprecated: implode(): Passing glue string after array is deprecated.
Hi,
I received this warning after doing an insert:
Deprecated: implode(): Passing glue string after array is deprecated. Swap the parameters in
<myfolder>/vendor/joshcam/mysqli-database-class/MysqliDb.php
on line1838
This is the stack trace, regarding MysqliDb:
ID | time | ? | name | location |
---|---|---|---|---|
6 | 0.2261 | 1699456 | MysqliDb->_buildInsert( ) | .../MysqliDb.php:816 |
7 | 0.2261 | 1699512 | MysqliDb->_buildQuery( ) | .../MysqliDb.php:1523 |
8 | 0.2261 | 1699512 | MysqliDb->_buildInsertQuery( ) | .../MysqliDb.php:1562 |
9 | 0.2261 | 1700848 | implode ( ) | .../MysqliDb.php:1838 |
I'm not trying to insert any fancy data structure, is just a simple associative array:
$data = [
'Nome' => $nome,
'Cognome' => $cognome,
'ragSociale' => $ragSociale,
'DataNascita' => $dnascita_mysql,
'LuogoNascita' => $lnascita,
'Nazionalita' => $naz,
'RagFiscale' => $rfisc,
'CodiceFiscale' => $cfisc,
'PIva' => $piva,
'Indirizzo' => $indirizzo,
'Civico' => $civico,
'Cap' => $cap,
'Localita' => $localita,
'Provincia' => $provincia,
'Tel' => $tel,
'Cel' => $cel,
'email' => $email,
'IBAN' => $iban,
'intestatario' => $intestatario,
'AgenziaID' => $agencyID,
'AgencyName' => $agencyName,
'ruoloID' => $roleID,
'roleName' => $roleName,
'SponsorID' => $sponsorID ?: NULL,
'SponsorName' => $sponsorName,
'dataRegistrazione' => $data_mysql,
'dataInizioRapporto' => $dataInizio_mysql,
'Note' => $note,
'photo' => '../Immagini/user.jpg'
];
The insert completes without problems, all data is in place. Anyway I think that this must be handled before further php updates, maybe in the future it can block the correct functioning of MysqliDb.
Cheers
Make sure use the latest version of MysqliDb.php
Remove it and run:
composer require thingengineer/mysqli-database-class:dev-master
Can please release new version tags?
Excuse me I encountered the warning with the latest stable version, and I couldn't find any open issue regarding this, so I opened a new one. If this is already planned to be fixed in the next release, just ignore it :-)
I have the same problem with PHP 7.4. Someone has checked if it is fixed with the last release?
I have the same problem with PHP 7.4. Someone has checked if it is fixed with the last release?
No, it still in :dev-master release, not last release.
This already have been fixed in #870 , download the master branch.
That's strange, I've updated the library on 19 oct and it was giving me that warning