dungpt8782 0 Posted June 15, 2014 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 Quote Share this post Link to post Share on other sites
0 dungpt8782 0 Posted June 16, 2014 somebody help me pls!!! Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted June 16, 2014 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 Quote Share this post Link to post Share on other sites
Hi, i'm newbie and i need to help for this problem:
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
Share this post
Link to post
Share on other sites