w000t Posted June 17, 2014 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 2 Reputation: 0 Joined: 02/25/14 Last Seen: November 8, 2015 Share Posted June 17, 2014 (edited) 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 June 17, 2014 by w000t Quote Link to comment Share on other sites More sharing options...
Emistry Posted June 17, 2014 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2372 Joined: 10/28/11 Last Seen: 15 hours ago Share Posted June 17, 2014 then....what you actually want ?? add credit into the database ?? or insert credit into the database ?? or both ?? Quote Link to comment Share on other sites More sharing options...
w000t Posted June 17, 2014 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 2 Reputation: 0 Joined: 02/25/14 Last Seen: November 8, 2015 Author Share Posted June 17, 2014 Yes, both. Quote Link to comment Share on other sites More sharing options...
Emistry Posted June 18, 2014 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2372 Joined: 10/28/11 Last Seen: 15 hours ago Share Posted June 18, 2014 INSERT INTO ........ ON DUPLICATE UPDATE `xyz` = `xyz + 1; it should be something like this... Quote Link to comment Share on other sites More sharing options...
Question
w000t
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 w000tLink to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.