PHP 8.2.24 Fatal Error

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
srenshaw
Posts: 2
Joined: 2018-11-13 16:34

PHP 8.2.24 Fatal Error

Post by srenshaw » 2024-10-09 18:14

My Webhost recently updated to PHP version 8.2.24 and I'm now experiencing an error when I try to update a record - the page does not refresh and the following error is logged:


[09-Oct-2024 18:15:05 Europe/London] PHP Fatal error: Uncaught TypeError: mysqli_fetch_row(): Argument #1 ($result) must be of type mysqli_result, bool given in /**DB_Path**/db.php:65
Stack trace:
#0 /**DB_Path**/db.php(65): mysqli_fetch_row(true)
#1 /**DB_Path**/admin/incFunctions.php(469): db_fetch_row(true)
#2 /**DB_Path**/hooks/XmasOrders.php(406): sqlValue('UPDATE XmasOrde...')
#3 /**DB_Path**/XmasOrders_dml.php(328): XmasOrders_after_update(Array, Array, Array)
#4 /**DB_Path**/datalist.php(349): XmasOrders_update('897', '')
#5 /**DB_Path**/XmasOrders_view.php(361): DataList->Render()
#6 {main}
thrown in /**DB_Path**/db.php on line 65



My code on line 406 in the XmasOrders.php Hook file referred to above is:

sqlValue("UPDATE XmasOrders SET SendEmail02='0' WHERE ID=$OrderID");


When I roll back the PHP version to 7.4.33, the are no errors and the order page refreshes correctly.


Any help would be greatly appreciated.

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1881
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: PHP 8.2.24 Fatal Error

Post by jsetzer » 2024-10-09 19:18

For update, insert and delete SQL commands, try replacing sqlValue() function call (which is meant for fetching data) by sql() function call.

That change helped me in the past.

Also, I recommend adding the 2nd $error parameter for evaluating errors, if any.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.14 Revision 1665 + all AppGini Helper tools

srenshaw
Posts: 2
Joined: 2018-11-13 16:34

Re: PHP 8.2.24 Fatal Error

Post by srenshaw » 2024-10-10 10:05

That fixed it - many thanks!!

Post Reply