Jump to content
  • 0
Manyak

query_sql not updating

Question

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 by Manyak

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Try it:

query_sql "UPDATE `char_reg_num_db` SET `value`=0 WHERE `key` = 'HuntCount'",@sql$;
Edited by Niunzin

Share this post


Link to post
Share on other sites
  • 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.

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?

Share this post


Link to post
Share on other sites
  • 0
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 by Manyak

Share this post


Link to post
Share on other sites
  • 0

maybe query_sql only affect offline Character, coz online Character's permanent variable
was stored in ram

Edited by Angelmelody

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.