query_sql not updating

Manyak

New member
Messages
3
Points
0
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.

 
Last edited by a moderator:
Try it:

Code:
query_sql "UPDATE `char_reg_num_db` SET `value`=0 WHERE `key` = 'HuntCount'",@sql$;
 
Last edited by a moderator:
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?

 
Last edited by a moderator:
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.

 
Last edited by a moderator:
maybe query_sql only affect offline Character, coz online Character's permanent variable
was stored in ram

 
Last edited by a moderator:
Back
Top