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.
Location: Asia Pacific, Cyberspace, in the Dark Dystopia
Posts: 19,118
Thanks Given: 2,351
Thanked 3,359 Times in 1,878 Posts
Quote:
Originally Posted by cbkihong
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.
It's time for bed for me. Same for you!
Oh! I forgot you are one hour ahead of me in HK.
Thanks again and goodnight. I will not be working on code much for the next 10 days, vacation time!
Our embryonic Bits Bank is now recording the bankfees in credits_transactions
I have several bash scripts that write to an SQLite3 database at the same time. At some occasion the database returns: SQL error: database is locked.
How would be the best way, to make a process to wait until the data base is 'free' again. I tried:
sqlite3 test.db ".timeout 1000; update....."... (2 Replies)
hi, i want to ask, how to make a plain text database (u need to call and search all the data manually) in PHP. i am going to apply it in UNIX os. anyone have any idea how to do it? most of the data only using mysql while i am forbid to do so. (2 Replies)
Hello all,
I completed a website (it was code by php) and putted it to AWS, I install fedora instance in EC2 with the base is php and mysql.
I putted all files of my website to folder /home/webuser/helloworld/htddocs and my database (mysql) to folder /var/lib/mysql/test ("test" is my... (2 Replies)
Hi All,
Please help me in writing data to a file in one row.
In database there is a column which contains large data which does not fit in the file in one row. The column contains list of paths. I want to write these paths to a file in one row.
Please find the code below writes :
... (2 Replies)
I want to collect the database tables(Ex: Emp,Sal,Bonus...etc)
in a file & give this file at the command prompt, when prompted for the tables list at command prompt. How can i do that ?
Ex:- Import jason/jason1 tables=emp,sal,bonus log=j1.log
i want to change this into
Ex:- Import... (3 Replies)