<globalevent name="lottery" interval="4050000" event="script" value="lottery.lua"/>
> Broadcasted message: "[LOTTERY SYSTEM] Winner: Owner, Reward: mastermind shiel
d! Congratulations! (Next Lottery in 3 Hours)".
[1:8:11.406] mysql_real_query(): INSERT INTO `lottery` (`name`, `item`) VALUES (
'Owner', 'mastermind shield'); - MYSQL ERROR: Table 'thais.lottery' doesn't exis
t (1146)
> Broadcasted message: "[LOTTERY SYSTEM] Winner: Owner, Reward: demon armor! Con
gratulations! (Next Lottery in 3 Hours)".
[1:8:22.187] mysql_real_query(): INSERT INTO `lottery` (`name`, `item`) VALUES (
'Owner', 'demon armor'); - MYSQL ERROR: Table 'thais.lottery' doesn't exist (114
6)
> Broadcasted message: "[LOTTERY SYSTEM] Winner: Owner, Reward: 10 crystal coins
! Congratulations! (Next Lottery in 3 Hours)".
[1:8:33.046] mysql_real_query(): INSERT INTO `lottery` (`name`, `item`) VALUES (
'Owner', 'crystal coin'); - MYSQL ERROR: Table 'thais.lottery' doesn't exist (11
46)
> Broadcasted message: "[LOTTERY SYSTEM] Winner: Owner, Reward: mastermind shiel
d! Congratulations! (Next Lottery in 3 Hours)".
[1:8:43.843] mysql_real_query(): INSERT INTO `lottery` (`name`, `item`) VALUES (
'Owner', 'mastermind shield'); - MYSQL ERROR: Table 'thais.lottery' doesn't exis
t (1146)
CREATE TABLE `lottery` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL,
`item` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO `lottery`(`id`, `name`, `item`) VALUES (NULL , 'Nobody', 'nothing');
i got this and the same error in the time @ghettobirdCode:> Broadcasted message: "[LOTTERY SYSTEM] Winner: Owner, Reward: mastermind shiel d! Congratulations! (Next Lottery in 3 Hours)". [1:8:11.406] mysql_real_query(): INSERT INTO `lottery` (`name`, `item`) VALUES ( 'Owner', 'mastermind shield'); - MYSQL ERROR: Table 'thais.lottery' doesn't exis t (1146) > Broadcasted message: "[LOTTERY SYSTEM] Winner: Owner, Reward: demon armor! Con gratulations! (Next Lottery in 3 Hours)". [1:8:22.187] mysql_real_query(): INSERT INTO `lottery` (`name`, `item`) VALUES ( 'Owner', 'demon armor'); - MYSQL ERROR: Table 'thais.lottery' doesn't exist (114 6) > Broadcasted message: "[LOTTERY SYSTEM] Winner: Owner, Reward: 10 crystal coins ! Congratulations! (Next Lottery in 3 Hours)". [1:8:33.046] mysql_real_query(): INSERT INTO `lottery` (`name`, `item`) VALUES ( 'Owner', 'crystal coin'); - MYSQL ERROR: Table 'thais.lottery' doesn't exist (11 46) > Broadcasted message: "[LOTTERY SYSTEM] Winner: Owner, Reward: mastermind shiel d! Congratulations! (Next Lottery in 3 Hours)". [1:8:43.843] mysql_real_query(): INSERT INTO `lottery` (`name`, `item`) VALUES ( 'Owner', 'mastermind shield'); - MYSQL ERROR: Table 'thais.lottery' doesn't exis t (1146)
0.4What tfs version do u use? >.<
Code:CREATE TABLE `lottery` ( `id` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL, `item` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
Code:INSERT INTO `lottery`(`id`, `name`, `item`) VALUES (NULL , 'Nobody', 'nothing');
http://otland.net/threads/mysql-how-to-run-a-query.177833/
In a few minutes I will finish my lottery script... You can use mine it then if you wantalrady added
[12/01/2015 19:03:07] [Error - GlobalEvent Interface]
[12/01/2015 19:03:07] data/globalevents/scripts/lottery.lua:onThink
[12/01/2015 19:03:07] Description:
[12/01/2015 19:03:07] data/globalevents/scripts/lottery.lua:18: attempt to get length of local 'list' (a number value)
[12/01/2015 19:03:07] stack traceback:
[12/01/2015 19:03:07] data/globalevents/scripts/lottery.lua:18: in function <data/globalevents/scripts/lottery.lua:8>
[12/01/2015 19:03:07] [Error - GlobalEvents::think] Couldn't execute event: lottery
You'll need to escape using an additional quote markHi, sorry for reviving this old post, i'm having a little trouble with this system, if the player has a name with ', example: Atom'rp, this error is shown in console:View attachment 46728
An error in my SQL syntax, this is my table structure, which type could work?
View attachment 46729
thanks in advance!
getCreatureName(winner)
getCreatureName(winner):gsub("'", "''")