Jump to content
  • 0

NPC not showing SQL Balance (SOLVED)


Question

Posted (edited)

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

4 answers to this question

Recommended Posts

  • 0
Posted
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.. ^_^

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...