Manyak 0 Posted July 25, 2014 (edited) Hello guys, I have an unexpected error, and I hope you can help me. I can't update `char_reg_num_db` with a query_sql. set .@sql, query_sql("UPDATE `char_reg_num_db` SET `value` = '0' WHERE `key` = 'HuntCount'"); The map-server show me no error, but my table is not updated. I worked on this all day long, and now I have no idea why this query doesn't update my table correctly. Thank you for your help. Edited July 26, 2014 by Manyak Quote Share this post Link to post Share on other sites
0 Manyak 0 Posted July 27, 2014 (edited) None has any idea ? Edited July 27, 2014 by Manyak Quote Share this post Link to post Share on other sites
0 Niunzin 18 Posted July 27, 2014 (edited) Try it: query_sql "UPDATE `char_reg_num_db` SET `value`=0 WHERE `key` = 'HuntCount'",@sql$; Edited July 27, 2014 by Niunzin Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted July 27, 2014 Hello guys, I have an unexpected error, and I hope you can help me. I can't update `char_reg_num_db` with a query_sql. set .@sql, query_sql("UPDATE `char_reg_num_db` SET `value` = '0' WHERE `key` = 'HuntCount'"); The map-server show me no error, but my table is not updated. I worked on this all day long, and now I have no idea why this query doesn't update my table correctly. Thank you for your help. I see no problem with the query, are you sure, that , that query is been executed by the script?Maybe show the part of script that uses that query? Quote Share this post Link to post Share on other sites
0 Manyak 0 Posted July 27, 2014 (edited) OnEventStart: if (!getvariableofnpc(.Enable_DailyMob, "settings")) end; do { set .i_MonsterId, callfunc("GetRandMob"); } while (getmonstername(.i_MonsterId) == "null"); set .@sql, query_sql("UPDATE `char_reg_num_db` SET `value` = '0' WHERE `key` = 'HuntCount'"); if (.@sql) { announce "The Daily Monster is " + getmonstername(.i_MonsterId)", bc_all; set .b_DailyMonsterIsRunning, 1; } else debugmes "[OnEventStart] - Query sql failed."; end; And this is what call my event 'OnEventStart': OnMinute25: if (gettime(3) == 10 || gettime(3) == 16 || gettime(3) == 22) donpcevent strnpcinfo(0)+"::OnEventStart"; else if (gettime(3) == 12 || gettime(3) == 18 || gettime(3) == 0) donpcevent strnpcinfo(0)+"::OnEventEnd"; end; I used to bind a command to skip waiting 10:25, 16:25 or 22:25. OnInit: bindatcmd(strnpcinfo(0), strnpcinfo(0)+"::OnEventStart", 99, 99); end; I still have no error or debugmes on my map-server. Thank you for helping me sir, Many. Edit: I made this script, cause I wanna see if I made a mistake. Try it: - script test -1,{ end; OnInit: bindatcmd(strnpcinfo(0), strnpcinfo(0)+"::OnEventStart"); bindatcmd(strnpcinfo(0)+"2", strnpcinfo(0)+"::OnEventEnd"); end;OnEventStart: set HuntCount, HuntCount + 1; dispbottom "OnEventStart: [" + HuntCount + "]"; end; OnEventEnd: set .@sql, query_sql("UPDATE `char_reg_num_db` SET `value` = '0' WHERE `key` = 'HuntCount'"); //query_sql "UPDATE `char_reg_num_db` SET `value` = '0' WHERE `key` = 'HuntCount'", @sql; //Doesn't work either dispbottom "OnEventEnd: [" + HuntCount + "]"; end;} In each case, .@sql and @sql are both equal to 0. Edited July 28, 2014 by Manyak Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted July 28, 2014 (edited) maybe query_sql only affect offline Character, coz online Character's permanent variablewas stored in ram Edited July 28, 2014 by Angelmelody Quote Share this post Link to post Share on other sites
Hello guys,
I have an unexpected error, and I hope you can help me.
I can't update `char_reg_num_db` with a query_sql.
The map-server show me no error, but my table is not updated.
I worked on this all day long, and now I have no idea why this query doesn't update my table correctly.
Thank you for your help.
Edited by ManyakShare this post
Link to post
Share on other sites