Helpful Information
 
 
Category: RPG Integration Hack
Lottery problem

The whole lottery seems to not work. :/


Database error in vBulletin 3.0.7:

Invalid SQL:
INSERT INTO
rpg_lottery
(lotteryid,
lotteryname,
lotterym,
prize,
dateset,
dateend,
cost,
sold,
active)
VALUES
(NULL,
'Lottery Boost!',
'Win 1000% of your ticket cost! Prize money: 1500! Get your ticket now!',
'1500',
'1108896591',
'03-20-2005',
'150',
'0',
'1')

mysql error: Table 'chyrule_forums.rpg_lottery' doesn't exist

mysql error number: 1146

That's what I get when I try to create a new lottery through the ACP.

Any help would be appreciated. Thank you.

Check to see if the table exists.
You can figure this out by going to Maintenance in your ACP, and "Repair/Optimize Tables".
If you see this table in the list of tables, then its there.

Nope. The closest thing to it is rpg_lottery_tickets. How can I get rpg_lottery?

By running this in the ACP:
CREATE TABLE `rpg_lottery` (
`lotteryid` int(5) NOT NULL auto_increment,
`lotteryname` varchar(20) NOT NULL default '',
`lotterym` varchar(50) NOT NULL default '',
`prize` int(10) NOT NULL default '0',
`dateset` varchar(35) NOT NULL default '',
`dateend` varchar(35) NOT NULL default '',
`cost` int(6) NOT NULL default '0',
`sold` int(5) NOT NULL default '0',
`active` int(2) NOT NULL default '0',
`editing` int(5) NOT NULL default '',
PRIMARY KEY (`lotteryid`,`lotteryid`)
) TYPE=MyISAM;


Remember to add a table prefix if you use one.

Thanks Revan, but there seems to be an error.

MySQL said:

#1060 - Duplicate column name 'lotteryid'

Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/common.lib.php on line 682

of course
Im rather embarrassed....
CREATE TABLE `rpg_lottery` (
`lotteryid` int(5) NOT NULL auto_increment,
`lotteryname` varchar(20) NOT NULL default '',
`lotterym` varchar(50) NOT NULL default '',
`prize` int(10) NOT NULL default '0',
`dateset` varchar(35) NOT NULL default '',
`dateend` varchar(35) NOT NULL default '',
`cost` int(6) NOT NULL default '0',
`sold` int(5) NOT NULL default '0',
`active` int(2) NOT NULL default '0',
`editing` int(5) NOT NULL default '',
PRIMARY KEY (`lotteryid`)
) TYPE=MyISAM;
Theres the correct code.
To my own defence I didnt write the lottery hack and it was probs the author of this hack who did it and its all his fault and and and....
*goes away*
;)


//peace

No problem at all Revan. Will test it out now. Thanks for all the help although I may come again soon. ;)










privacy (GDPR)