Hi, I would like to know how to update an existing data in sql_query. I made a Donation NPC with a Donor Ranking. I've somehow made it work but when I donate twice. I want to add my last donation and my current donation in the ranking. Instead of creating a new one. And also, I would like to know how ORDER BY works. I want it ordered by ascending, but clearly I made some mistake because it did not work. Here is my code:
case 2:
mes "test";
query_logsql "SELECT `name`, `donateamount` FROM `donornames` ORDER BY `donornames`.`donateamount`", .@donor_name$, .@donate_amount;
for (set .@i, 0; .@i < getarraysize(.@donate_amount); set .@i, .@i+1){
mes "^296900["+.@i+"]^000000 - " + "^ff4d00" + .@donor_name$[.@i] + "^000000 has bought " + .@donate_amount[.@i] + " donation tickets.";
}//endfor
close;
INGAME SCREENSHOT:
As you can see here, TEST has donated twice, I want it to show 700 instead of 2 separate lines of 200 and 500. Also I would like it to be in ascending order; the highest donors at the top, while the lowest at the bottom. And I'm sure it's possible with ORDER BY but I'm sure I used it incorrectly. Same with UPDATE.