ThingEngineer / PHP-MySQLi-Database-Class

Wrapper for a PHP MySQL class, which utilizes MySQLi and prepared statements.
Other
3.3k stars 1.34k forks source link

Not working with PHP 8.1.2 #998

Open thistehneisen opened 2 years ago

thistehneisen commented 2 years ago
PHP message: PHP Fatal error: Uncaught TypeError: implode(): Argument #2 ($array) must be of type ?array, string given in /var/www/vhosts/[hidden]/httpdocs/vendor/thingengineer/mysqli-database-class/MysqliDb.php:1838\nStack trace:\n#0 /var/www/vhosts/[hidden]/httpdocs/vendor/thingengineer/mysqli-database-class/MysqliDb.php(1838): implode()\n#1 /var/www/vhosts/[hidden]/httpdocs/vendor/thingengineer/mysqli-database-class/MysqliDb.php(1562): MysqliDb->_buildInsertQuery()\n#2 /var/www/vhosts/[hidden]/httpdocs/vendor/thingengineer/mysqli-database-class/MysqliDb.php(1523): MysqliDb->_buildQuery()\n#3 /var/www/vhosts/[hidden]/httpdocs/vendor/thingengineer/mysqli-database-class/MysqliDb.php(816): MysqliDb->_buildInsert()\n#4 /var/www/vhosts/[hidden]/httpdocs/library/xhr.php(47): MysqliDb->insert()\n#5 {main}\n thrown in /var/www/vhosts/[hidden]/httpdocs/vendor/thingengineer/mysqli-database-class/MysqliDb.php on line 1838', referer: https://www.[hidden]/
ehylla93 commented 2 years ago

Just change the line into:

$this->_query .= ' (' . implode(', ', $dataColumns) . ') ';