Jump to content
  • 0

NPC not showing SQL Balance (SOLVED)


rakuzas

Question


  • Group:  Members
  • Topic Count:  152
  • Topics Per Day:  0.03
  • Content Count:  459
  • Reputation:   7
  • Joined:  06/29/12
  • Last Seen:  

Hi,

I tried to make NPC to shows balance from SQL.. But each time I talk to that NPC, it keep shows 0 Points.. But my database have 7 points.. Tried almost 1 hour and keep googling around but still no luck.. Below is my sample script :

 

prontera,150,150,5	script	Sample	861,{

mes " Hi";
    if (select("Yes:No") - 1) close;
	
query_sql ("SELECT `balance` FROM `test` WHERE 'id' = 1", .BalancePoints);

mes "Your balance is "+(.BalancePoints)+"point .. ";
close;
}

 

Below is my table :

test.png

Edited by rakuzas
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 1

  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3144
  • Reputation:   1630
  • Joined:  03/26/12
  • Last Seen:  

Try `id` instead of 'id'. Column names use ` .

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  152
  • Topics Per Day:  0.03
  • Content Count:  459
  • Reputation:   7
  • Joined:  06/29/12
  • Last Seen:  

1 hour ago, Akkarin said:

Try `id` instead of 'id'. Column names use ` .

Ahhh.. One small mistake.. My bad not notice that for almost a hour tried figure what's wrong.. xD

Thank you.. Now its working.. ^_^

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10018
  • Reputation:   2369
  • Joined:  10/28/11
  • Last Seen:  

you should change

.BalancePoints

to

.@BalancePoints

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  152
  • Topics Per Day:  0.03
  • Content Count:  459
  • Reputation:   7
  • Joined:  06/29/12
  • Last Seen:  

11 minutes ago, Emistry said:

you should change


.BalancePoints

to


.@BalancePoints

 

Ok.. Thank you~

Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...