I added a field bankfee in credits_transactions but it is not writing to the database (no PHP error).
Can someone take a look at the attached PHP file and see if they can find out why bankfee in the database table credits_transactions does not update from the initialized value of zero?
If I traced correctly, the part you mentioned will be triggered by the donate form from the user CP. However, I fail to locate any form parameter matching the name "bankfee", where the code is trying to perform some sentry of the form data.
I suggest you print_r($vbulletin->GPC) after clean_array_gpc() and verify whether you still have the "bankfee" key and bear a non-zero value. My guess is that there is none. You can use error_log() to write the output to PHP log file (if configured).
There will be no value (or maybe zero, initialized) for $bankfee immediately after clean_array_gpc() because $bankfee is calucated after clean_array_gpc().
So since $donatefee = $bankfee that means passing $vbulletin->GPC['bankfee'] to $db->query_write() does not work, but when I do:
//$bankfee = $vbulletin->GPC['donatefee'];
I get an error and the script fails.
What should I pass to $db->query_write() ?
-----Post Update-----
Hi cbkihong,
OK, it working fine now, thanks for the hints.
I replaced:
$vbulletin->GPC['bankfee'] in $db->query_write() with $bankfee
Glad you figured it out. Thanks for confirming you indeed modified some additional code as I thought that variable should not have been passed from outside the server, obviously, for security reasons.