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

Doesn't work on php8.1.17 (Debian 10) #1013

Closed detailcore closed 4 months ago

detailcore commented 1 year ago

// init.php $timeFromDb = date("Y-m-d H:i:s");

// "UPDATE dle_url_chapters SET chapter_parsed = '2023-03-23 18:29:27' WHERE dle_url_chapters.id = '48510'" $a0_query = "UPDATE dle_url_chapters SET chapter_parsed = '$timeFromDb' WHERE dle_url_chapters.id = '$chapter_id'";

$db->query($a0_query); // line 90

PHP Fatal error: Uncaught mysqli_sql_exception: MySQL server has gone away in /db/MysqliDb.php:1998 Stack trace:

0 /db/MysqliDb.php(1998): mysqli->prepare()

1 /db/MysqliDb.php(1601): MysqliDb->_prepareQuery()

2 /db/MysqliDb.php(662): MysqliDb->_buildQuery()

3 /init.php(90): MysqliDb->query()

4 {main}

thrown in /db/MysqliDb.php on line 1998

RivenSkaye commented 1 year ago

Can you try changing that line on your local copy?

- if ($this->traceEnabled)

+ if (isset($this->traceEnabled) && $this->traceEnabled)

Found this being used in some old code at work and figured I'd try and do a batch fix for some of the smaller issues. Seems to me like the lack of a default value is causing an error here