Jump to content
  • 0
dungpt8782

Need help with Cash point from donate !!!

Question

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 :(

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0
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

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.