• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Modern ACC] Error with lottery system

ERAGOS

New Member
Joined
Feb 18, 2010
Messages
45
Reaction score
1
Hello
I have error with this code:
<?PHP
require("config.php");
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = >$ots-getDBHandle();
$lottery = >$SQL-query('SELECT id, name, item, world_id FROM lottery WHERE world_id = 0 ORDER BY id DESC LIMIT 1;');
foreach($lottery as $result) {
ECHO '
<table border="0px" cellspacing="1px" cellpadding="4px" width="100%">
<tr bgcolor="#eeddb9" style="color: red;"><th width="100%"><center>Lottry</center></th></tr>
<tr><td><center>Every X hours we will choose one player who will win random item!</tr></td>
<tr><td><center>Last Winner on '.$config['server_name'].' is <b><a href="'.WEBSITE.'/index.php/character/view/'.urlencode($result['name']).'">'.$result['name'].'</a></b> won <i>'.$result['item'].'</i> Congratulations!</tr></td>
</td></table>';
}
$lottery2 = >$SQL-query('SELECT id, name, item, world_id FROM lottery WHERE world_id = 1 ORDER BY id DESC LIMIT 1;');
foreach($lottery2 as $result) {
ECHO '<table border="0px" cellspacing="1px" cellpadding="4px" width="100%">
<tr><td><center>Last Winner on World1: <a href="/index.php/character/view/'.urlencode($result['name']).'">'.$result['name'].'</a> won <i>'.$result['item'].'</i> Congratulations!</center></tr></td>';
ECHO '</table><br />';
}
>?


Error:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'world_id' in 'field list'' in /home/extraktor/public_html/system/pages/lottery.php:6 Stack trace: #0 /home/extraktor/public_html/system/pages/lottery.php(6): PDO->query('SELECT id, name...') #1 /home/extraktor/public_html/system/application/controllers/p.php(13): include('/home/extraktor...') #2 [internal function]: p->v('lottery') #3 /home/extraktor/public_html/system/codeigniter/CodeIgniter.php(236): call_user_func_array(Array, Array) #4 /home/extraktor/public_html/index.php(157): require_once('/home/extraktor...') #5 {main} thrown in /home/extraktor/public_html/system/pages/lottery.php on line 6

I added all tables in my database
Please help me fast! ;>
Thanks!
 
Back
Top