Points not updating

Jedzkie

The Master of White Spaces
Messages
632
Points
0
Age
33
Location
Philippines
Discord
✪ Jedzkie#0662
IRC Nickname
Jedzkie
Github
Jedzkie
Emulator
Client Version
2016-03-16 RE
hi again! i 'm gonna ask something about my problem, i use #VOTEPOINTS in my server and converts it to "cp_credits" in my sql,

but my problem is it does not add 1 point in sql but i already converted it in npc, it works when 1 have a 1 point, but it dont work if i dont have points, here's my query_sql script

Code:
query_sql "UPDATE `cp_credits` SET `balance` = `balance` +1 " WHERE `account_id` = " + getcharid(3) + " AND `balance` <> 0;";
 
i already removed, but still nothing happens.

 
i already removed, but still nothing happens.
I thought null+1=1, wrong moves then

try

query_sql "UPDATE `cp_credits` SET `balance`=IF(`balance` IS NULL,1,`balance`+1) WHERE `account_id`="+getcharid(3);
or

Code:
query_sql "UPDATE `cp_credits` SET `balance`=COALESCE(`balance`+1,1) WHERE `account_id`="+getcharid(3);
 
Last edited by a moderator:
Back
Top