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

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1191
Joined: 2019-05-21 22:42
Location: Germany
Contact:

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

Post by onoehring » 2023-05-05 10:27

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

User avatar
a.gneady
Site Admin
Posts: 1294
Joined: 2012-09-27 14:46
Contact:

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

Post by a.gneady » 2023-05-28 09:11

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
:idea: AppGini plugins to add more power to your apps:

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1191
Joined: 2019-05-21 22:42
Location: Germany
Contact:

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

Post by onoehring » 2023-06-03 07:36

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

User avatar
a.gneady
Site Admin
Posts: 1294
Joined: 2012-09-27 14:46
Contact:

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

Post by a.gneady » 2023-06-03 09:29

Glad it's fixed now :)
:idea: AppGini plugins to add more power to your apps:

Post Reply