Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
detailcore opened this issue Mar 23, 2023 · 1 comment · May be fixed by #1018
Open

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

detailcore opened this issue Mar 23, 2023 · 1 comment · May be fixed by #1018

Comments

@detailcore
Copy link

// 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
Copy link

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

RivenSkaye added a commit to RivenSkaye/PHP-MySQLi-Database-Class that referenced this issue Jul 24, 2023
@RivenSkaye RivenSkaye linked a pull request Jul 25, 2023 that will close this issue
stormwalkerec added a commit to stormwalkerec/php-mysqli-database-class that referenced this issue Mar 31, 2024
Fixes ThingEngineer#1016 by setting the defaults to an empty string; This matches nothing without notices about nulls.
Fixes ThingEngineer#1013 by defaulting to false instead of not initializing.
Fixes ThingEngineer#1015 by adding the missing null in the docstring. Re-aligned the other lines and fixed a typo.
Fixes ThingEngineer#1001 by special handling of stdClass objects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants