Hello everyone, quest problem please help

10/30/2014 22:15 cypheredu#1
Hello guys, i'm sorry if i posted in the wrong section. i have this quest:

Quote:
quest warn begin
state start beginwhen9005.chat."Add warn "with pc.is_gm()begin
say_title("Add warn: ")
say("Enter player's full name: ")local meno = input()
say_title("Add warn: ")
say("Enter reason:")
say("")local dvovod = input()
say("To grant a warning: ")
say_reward(meno)
say("because: ")
say_reward(dvovod)local acc_id = mysql_query("SELECT account_id FROM player.player WHERE name='"..meno.."' LIMIT 1 ;")
say("Your account id: "..acc_id.account_id[1].." .")
say("")local uloha =select("Yes","No")if uloha ==1then
say_title("Add warn: ")
mysql_query("INSERT INTO account.varovania (ucet_id,od,dvovod,cas) VALUES ('"..acc_id.account_id[1].."','"..pc.get_name().."','"..dvovod.."','"..os.d ate().."')")
say("Warning for "..meno.." ("..acc_id.account_id[1]..") has been granted. ")
say("Because "..dvovod..". ")
say("")else
say_title("Add warning: ")
say_reward("Warning for "..meno.." not granted. ")
say("")endendendend


and i get the following error

Quote:
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1' at line 2
[Err] CREATE TABLE `varovania`(`id`int(11) NOT NULL AUTO_INCREMENT,`ucet_id`int(30) NOT NULL DEFAULT '',`od` varchar(45) NOT NULL DEFAULT '',`dvovod` varchar(255) DEFAULT NULL,`cas` varchar(255) DEFAULT '',
PRIMARY KEY (`id`),) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1
[Msg] Finished - Unsuccessfully

what did i do wrong?

thanks in advance
10/31/2014 08:35 Nightmare™#2
belongs in here -> [Only registered and activated users can see links. Click Here To Register...]

#moverequest
10/31/2014 15:47 Zevion#3
#moved
10/31/2014 17:35 .Various#4
Code:
quest warn begin
	state start begin
		when 9005.chat."Add warn "with pc.is_gm()begin
			say_title("Add warn: ")
			say("Enter player's full name: ")
			local meno = input()
			say_title("Add warn: ")
			say("Enter reason:")
			say("")
			local dvovod = input()
			say("To grant a warning: ")
			say_reward(meno)
			say("because: ")
			say_reward("dvovod")
			local acc_id = mysql_query("SELECT account_id FROM player.player WHERE name='"..meno.."' LIMIT 1 ;")
			say("Your account id: "..acc_id.account_id[1].." .")
			say("")
			local uloha =select("Yes","No")
			if uloha ==1then
				say_title("Add warn: ")
				mysql_query("INSERT INTO account.varovania (ucet_id,od,dvovod,cas) VALUES ('"..acc_id.account_id[1].."','"..pc.get_name().."','"..dvovod.."','"..os.d ate().."')")
				say("Warning for "..meno.." ("..acc_id.account_id[1]..") has been granted. ")
				say("Because "..dvovod..". ")
				say("")
			else
				say_title("Add warning: ")
				say_reward("Warning for "..meno.." not granted. ")
				say("")
			end
		end
	end
end
What should the quest do?
10/31/2014 19:08 cypheredu#5
it seems that the quest is ok but it doesnt create the table "varovania" and i dunno why...

could it be because it needs some elevated permissions or something?