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

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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

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