Page 1 of 1

AG 23.11 v1365 (PHP 8): function sqlValue returns boolean

Posted: 2023-05-05 10:27
by onoehring
Hi,

is it just me or are others having the same problem.
Using PHP 8 I suddenly get errors when a statement sent to sqlValue wold not return a row, instead FALSE is returned.
Looks like this
PHP Fatal error: Uncaught TypeError: mysqli_fetch_row(): Argument #1 ($result) must be of type mysqli_result, bool given in #0 C:\\Users\\myAGApplication\\db.php:59
Stack trace:
#0 C:\\Users\\myAGApplication\\db.php(59): mysqli_fetch_row()
#1 C:\\Users\\myAGApplication\\admin\\incFunctions.php(1133): db_fetch_row()
#2 ...
Don't mind the double backslash (\\) - this is not the problem.

Olaf

Re: AG 23.11 v1365 (PHP 8): function sqlValue returns boolean

Posted: 2023-05-28 09:11
by a.gneady
This can happen if the SQL query passed to sqlValue() has an error. You didn't include the full stack trace in the error message so it's not clear which file triggered the error. But you can check the query error in the admin area > Utilities menu > Query logs

Re: AG 23.11 v1365 (PHP 8): function sqlValue returns boolean

Posted: 2023-06-03 07:36
by onoehring
Hi Ahmed,

thanks for your reply. I checked for php8 errors and it seemed that I was using the sqlValue function to send non-SELECT SQL (but INSERT, UPDATE...) which made the error pop up.
By now it's solved, but do not ask me now how I did it - it's almost one month ago :-)

Olaf

Re: AG 23.11 v1365 (PHP 8): function sqlValue returns boolean

Posted: 2023-06-03 09:29
by a.gneady
Glad it's fixed now :)