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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

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