Error in Hooks - Fatal error: Uncaught TypeError: mysqli_fetch_row

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
selectsteel
Posts: 26
Joined: 2013-09-23 14:14

Error in Hooks - Fatal error: Uncaught TypeError: mysqli_fetch_row

Post by selectsteel » 2022-08-09 21:00

function receipts_after_update($data, $memberInfo, &$args) {
if ($username != 'admin'){sqlValue("UPDATE membership_userrecords SET memberID='admin' WHERE pkValue='{$data['job_id']}'");}

Code does what I want and sets the owner of the records to admin but throws this error.

Fatal error: Uncaught TypeError: mysqli_fetch_row(): Argument #1 ($result) must be of type mysqli_result, bool given in C:\xampp\htdocs\ifcc\db.php:59 Stack trace: #0 C:\xampp\htdocs\ifcc\db.php(59): mysqli_fetch_row(true) #1 C:\xampp\htdocs\ifcc\admin\incFunctions.php(489): db_fetch_row(true) #2 C:\xampp\htdocs\ifcc\hooks\receipts.php(91): sqlValue('UPDATE membersh...') #3 C:\xampp\htdocs\ifcc\receipts_dml.php(284): receipts_after_update(Array, Array, Array) #4 C:\xampp\htdocs\ifcc\datalist.php(318): receipts_update('7', '') #5 C:\xampp\htdocs\ifcc\receipts_view.php(140): DataList->Render() #6 {main} thrown in C:\xampp\htdocs\ifcc\db.php on line 59

selectsteel
Posts: 26
Joined: 2013-09-23 14:14

Re: Error in Hooks - Fatal error: Uncaught TypeError: mysqli_fetch_row

Post by selectsteel » 2022-08-10 18:38

I changed the statement like so and get not errors.
if ($username != 'admin'){
sql("UPDATE membership_userrecords SET memberID='admin', groupID=2 WHERE pkValue='{$data['job_id']}'",$eo);
}

Post Reply