Hello everyone, just wanted to know on how to do this in game..
Don't know if this belongs here or in the scripting section, sorry if I'm wrong..
I have an npc which looks for the guild id of a specific guild which will be an input in the npc..
I have use this sql query and its working:
query_sql "SELECT `guild_id` FROM `guild` WHERE `name` = '"+@guild_name$+"'",@type_id;
The problem is, I want the name to be exact.
For example,
I was looking for the guild id of test, and I have input in the npc test123. It would still be able to get the ID of test guild but instead I want the npc to input it as not existing since there is really a no guild name of test123 and it should be test only.
Another example again for guild test,
If I input tes only, It would still be able to get the ID of test guild but instead I want the npc to input it as not existing since there is really a no guild name of tes and it should be test.
So what I am aiming is a sql query with an exact match of the input..
I have searched in google how to do this and find this:
add % before and after the string and use LIKE
Example:
query_sql "SELECT `guild_id` FROM `guild` WHERE `name` LIKE ' %guild_name% ' "
But I can't integrate it with the script:
query_sql "SELECT `guild_id` FROM `guild` WHERE `name` LIKE ' "+%@guild_name$%+"' ",@type_id;
or
query_sql "SELECT `guild_id` FROM `guild` WHERE `name` LIKE '%"+@guild_name$+"%' ",@type_id;
Doesn't work for me.. xD
So if anyone knows how to do what I wanted to do, please share it to me.. xD
Question
Elijah23
Hello everyone, just wanted to know on how to do this in game..![:)](https://rathena.org/board/uploads/emoticons/default_smile.png)
Don't know if this belongs here or in the scripting section, sorry if I'm wrong..
I have an npc which looks for the guild id of a specific guild which will be an input in the npc..
I have use this sql query and its working:
The problem is, I want the name to be exact.
For example,
I was looking for the guild id of test, and I have input in the npc test123. It would still be able to get the ID of test guild but instead I want the npc to input it as not existing since there is really a no guild name of test123 and it should be test only.
Another example again for guild test,
If I input tes only, It would still be able to get the ID of test guild but instead I want the npc to input it as not existing since there is really a no guild name of tes and it should be test.
So what I am aiming is a sql query with an exact match of the input..
I have searched in google how to do this and find this:
add % before and after the string and use LIKE
Example:
But I can't integrate it with the script:
or
Doesn't work for me.. xD
So if anyone knows how to do what I wanted to do, please share it to me.. xD
Advance thanks!..![:)](https://rathena.org/board/uploads/emoticons/default_smile.png)
Edited by wakoko321Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.