Need help with Cash point from donate !!!

dungpt8782

New member
Messages
63
Points
0
Age
43
Emulator
Hi, i'm newbie and i need to help for this problem:

$sql = "SELECT value AS acc_cash FROM {$server->charMapDatabase}.acc_reg_num_db WHERE key='#CASHPOINTS' AND account_id={$session->account->account_id}"; $sth = $server->connection->getStatement($sql); $sth->execute(); $oldcash = $sth->fetch()->acc_cash; if ($oldcash > 0){ $cashpoint = $oldcash + $newcash; $sql = "UPDATE {$server->charMapDatabase}.acc_reg_num_db SET value = '".$cashpoint."' WHERE key='#CASHPOINTS' AND account_id={$session->account->account_id}"; $sth = $server->connection->getStatement($sql); $sth->execute(); } else { $cashpoint = $newcash; $sql = "INSERT INTO {$server->charMapDatabase}.acc_reg_num_db (`key`,`value`,`type`,`account_id`) VALUES ('#CASHPOINTS',$cashpoint,2,{$session->account->account_id})"; $sth = $server->connection->getStatement($sql); $sth->execute();
This code used to make for rAthena serrver.

Now i change it to use with Hercules but its not work. Someone can help me pls!!!

Sorry, my English is bad, i hope you can understand me
default_sad.png


 
This code used to make for rAthena serrver.Now i change it to use with Hercules but its not work. Someone can help me pls!!!Sorry, my English is bad, i hope you can understand me 
Actually, this should not work with rA, since acc_reg_num_db doesn't exist in rA, 

and I don't see any problem in the script, except if $server variable is not set properly

 
Last edited by a moderator:
Back
Top