PHP-MySQLi-Database-Class icon indicating copy to clipboard operation
PHP-MySQLi-Database-Class copied to clipboard

php 7.4 - Deprecated: implode(): Passing glue string after array is deprecated.

Open funder7 opened this issue 4 years ago • 8 comments

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 line 1838

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

funder7 avatar Oct 12 '20 14:10 funder7

Make sure use the latest version of MysqliDb.php

yustana avatar Oct 13 '20 03:10 yustana

Remove it and run:

composer require thingengineer/mysqli-database-class:dev-master

kythuatwebso avatar Oct 14 '20 03:10 kythuatwebso

Can please release new version tags?

jjasoncool avatar Oct 16 '20 09:10 jjasoncool

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 :-)

funder7 avatar Oct 19 '20 11:10 funder7

I have the same problem with PHP 7.4. Someone has checked if it is fixed with the last release?

EspertoMagento avatar Nov 25 '20 08:11 EspertoMagento

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.

jjasoncool avatar Nov 27 '20 02:11 jjasoncool

This already have been fixed in #870 , download the master branch.

harryqt avatar Dec 03 '20 23:12 harryqt

That's strange, I've updated the library on 19 oct and it was giving me that warning

funder7 avatar Dec 07 '20 21:12 funder7