Jump to content
  • 0
Sign in to follow this  
Jedzkie

Points not updating

Question

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

 

 

query_sql "UPDATE `cp_credits` SET `balance` = `balance` +1 " WHERE `account_id` = " + getcharid(3) + " AND `balance` <> 0;";

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

i already removed, but still nothing happens.

Share this post


Link to post
Share on other sites
  • 0

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

query_sql "UPDATE `cp_credits` SET `balance`=COALESCE(`balance`+1,1) WHERE `account_id`="+getcharid(3);
Edited by mleo1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

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