WordsUp Posted December 29, 2011 Posted December 29, 2011 I have created this code for my server and inserted it on my agit_template.txt file but the problem is everytime the emp is broken it didn't return query_sql "SELECT `char_id` FROM `char` WHERE `char_id` = '"+getcharid(0)+"'",@exist$; if (getarraysize(@exist$) != 0){ query_sql "UPDATE `char` SET `empbreak` = `empbreak` + '1' WHERE `char_id` = '"+getcharid(0)+"'"; end; } query_sql "SELECT `guild_id` FROM `woe_guild_breaks` WHERE `guild_id` = '"+getcharid(2)+"'",@GDExist$; if (getarraysize(@GDExist$) != 0){ query_sql "UPDATE `woe_guild_breaks` SET `id` = `id` + '1' WHERE `guild_id` = '"+getcharid(2)+"'"; } else { query_sql "INSERT INTO `woe_guild_breaks` (`castle_id`, `guild_id`, `id`) VALUES ('15','"+getcharid(2)+"','1')"; end; } Quote
JayPee Posted December 29, 2011 Posted December 29, 2011 (edited) char_id is a integer i guess it should be @exist guild_id is a integer i guess it should be @GDExist I guess your insert command must be like this query_sql "INSERT INTO `woe_guild_breaks` (`castle_id`, `guild_id`, `id`) VALUES ('15',"+getcharid(2)+",1)"; [/code] Edited December 29, 2011 by JayPeeMateo Quote
WordsUp Posted December 29, 2011 Author Posted December 29, 2011 char_id is a integer i guess it should be @exist guild_id is a integer i guess it should be @GDExist I guess your insert command must be like this query_sql "INSERT INTO `woe_guild_breaks` (`castle_id`, `guild_id`, `id`) VALUES ('15',"+getcharid(2)+",1)"; [/code] the query_sql works fine it saves into my sql correctly. the char_id and guild_id i didn't understand sorry. Quote
JayPee Posted December 29, 2011 Posted December 29, 2011 char_id and guild_id both returns an integer or numerical value. a variable that ends with a $ means it is a string variable but a variable do not end with a $ it is considered as integer or numerical variable .myvar$ - this is string variable. .myvar - this is integer or numerical variable. Quote
WordsUp Posted December 29, 2011 Author Posted December 29, 2011 ahh okay thanks i will try that Quote
Question
WordsUp
I have created this code for my server and inserted it on my agit_template.txt file but the problem is everytime the emp is broken it didn't return
4 answers 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.