Jump to content
  • 0

I need help - ticket credits sql


w000t

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  2
  • Reputation:   0
  • Joined:  02/25/14
  • Last Seen:  

Hi!

 

How do I add credits ( fluxcp) using sql?

 

If the player does not have credit it uses the INSERT INTO sql command. If the player has credits it uses only the UPDATE sql command to add more credit.

 

 

20400,Credits_ticket,Credits_ticket,0,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ query_sql("UPDATE `rathenadb`.`cp_credits` SET `balance` = +'1000' WHERE `cp_credits`.`account_id` = 2000000;");},{},{}

 

 

Thanks!

Edited by w000t
Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

then....what you actually want ??

 

add credit into the database ??

or

insert credit into the database ??

or

both ??

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  2
  • Reputation:   0
  • Joined:  02/25/14
  • Last Seen:  

Yes, both.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

INSERT INTO ........ ON DUPLICATE UPDATE `xyz` = `xyz + 1;

it should be something like this...

Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...