diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-03-28 01:14:46 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-03-28 01:14:46 -0300 |
commit | 5337c09791160b96552dfe2480c56d7891830801 (patch) | |
tree | f376706f72442503ddbbe9ebf83c51bd8ccb1475 | |
parent | d9bddb94ac69ca93ee2e92e0f814f41158d4724c (diff) | |
download | serverdata-5337c09791160b96552dfe2480c56d7891830801.tar.gz serverdata-5337c09791160b96552dfe2480c56d7891830801.tar.bz2 serverdata-5337c09791160b96552dfe2480c56d7891830801.tar.xz serverdata-5337c09791160b96552dfe2480c56d7891830801.zip |
Improve a bit our SQL queries syntax
-rw-r--r-- | npc/functions/main.txt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/npc/functions/main.txt b/npc/functions/main.txt index 6bcc6d515..8fc2accc1 100644 --- a/npc/functions/main.txt +++ b/npc/functions/main.txt @@ -368,28 +368,28 @@ function script delinventorylist { // Get some acc id, even if offline // ( Name ) function script gf_accid { - .@nb = query_sql("SELECT account_id FROM `char` WHERE name='"+escape_sql(getarg(0))+"' LIMIT 2", .@value); + .@nb = query_sql("SELECT `account_id` FROM `char` WHERE `name`='"+escape_sql(getarg(0))+"' LIMIT 1", .@value); return .@value[0]; } // Get some char id, even if offline // ( Name ) function script gf_charnameid { - .@nb = query_sql("SELECT char_id FROM `char` WHERE name='"+escape_sql(getarg(0))+"' LIMIT 2", .@value); + .@nb = query_sql("SELECT `char_id` FROM `char` WHERE `name`='"+escape_sql(getarg(0))+"' LIMIT 1", .@value); return .@value[0]; } // Get some char name from char ID, even if offline // ( Name ) function script gf_charname { - .@nb = query_sql("SELECT name FROM `char` WHERE char_id="+escape_sql(getarg(0))+" LIMIT 2", .@value$); + .@nb = query_sql("SELECT `name` FROM `char` WHERE `char_id`="+escape_sql(getarg(0))+" LIMIT 1", .@value$); return .@value$[0]; } // Get some char ID from account ID, even if offline // ( Name ) function script gf_charid { - .@nb = query_sql("SELECT char_id FROM `char` WHERE account_id="+escape_sql(getarg(0))+" LIMIT 1", .@value$); + .@nb = query_sql("SELECT `char_id` FROM `char` WHERE `account_id`="+escape_sql(getarg(0))+" LIMIT 1", .@value$); return .@value$[0]; } |