• 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!

Lua Zombie Plage PHP Error

Friizee

Member
Joined
Jul 26, 2008
Messages
193
Reaction score
5
Hello Otleaders,

I have the website of zombie and I get the following error:
Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: record

Filename: pages/zombieevent.php

Line Number: 33

PHP:

Code:
      <div class='message'>
        <div class='title'>Zombie event</div>
        <div class='content'>
        <?PHP
require("config.php");
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = $ots->getDBHandle();
echo '<table border="0" cellspacing="1" cellpadding="5" width=100% class="cellspadding">
    <center><img src="'.WEBSITE.'/public/images/zombie.png" width="50%" height="50%"/></center><br/>
    <tr class="tableheader">
    <TD align="center">En que consiste Zombie Event?</TD>
    </TR>
    </TABLE> 
    <table border="0" cellspacing="1" cellpadding="5" width=100% class="cellspadding">
            <tr class="tablerow"> 
                <TD width="30%"> 
                    <center><b>Objective</b><br />¿De que trata el zombie evento.</center> 
                </TD> 
                <TD width="70%"> 
                    <center>Todos los días a las 17:00  <b>5pm </b>, se abrira un teleport en el templo por unos minutos,y luego se cerrara..</center> 
                </TD> 
            </TR> 
            <tr class="tablerow"> 
                <TD width="30%"> 
                    <center><b>Desarrollo del evento</b><br />Zombie Plague events</center> 
                </TD> 
                <TD width="70%"> 
                    <center>Una vez cerrado el teleport, pasado unos segundos comenzaran a convocarse un Zombie cada 20 segundos y se informara cuantos zombies hay en la zona del evento y cuantos players vivos Se necesitaran al menos 5 players para que comience el evento y un maximo de 100 players.La idea es escapar de los Zombies, ya que si nos matan, perderemos el evento, el ultimo que muera, como se dijo anteriormente, gana.Es importante notar que al morir, no perderan nada, solo seran descalificados del evento...</center> 
                </TD> 
            </TR>
            <tr class="tablerow"> 
                <TD width="30%"> 
                    <center><b>Que es un zombie?</b><br />Beneficios?</center> 
                </script></strong></span><br/>  ' . $record['score'] . '</a></td><td><img src="'.WEBSITE.'/public/images/zombie2.gif"></td></tr></table>
                </TD> 
                <TD width="70%"> 
                    <center>Un zombie es un mounstruo invulnerable que camina muy lento pero ataca mucho y el beneficio una medalla vip..</center> 
                </TD> 
            </TR> 
        </TABLE> 
        
        <br /><br />';


$zombie = $SQL->query("
    SELECT w.id AS id, w.time AS time, g.name AS evento, p.name AS name, w.started AS start
        FROM zombie AS w
    INNER JOIN players AS p
        ON p.id = w.breaker
    INNER JOIN evento AS g
    ORDER BY id DESC LIMIT 10;    
")->fetchAll();

if(empty($zombie)) {
    echo '
    <table border="0" cellspacing="0" cellpadding="5" width="100%" class="cellspadding">
    <tr class="tableheader">
    <TD align="center">Jugador ganador</TD>
    </TR>
    <tr class="tablerow">
    <td align="center">No ahy ganadores.</td>
    </tr>
    </TABLE>
    ';
} 
else 
{
foreach ($zombie as $k=>$v) {
    echo "<table border='0' cellspacing='1' cellpadding='5' width=100% class='cellspadding'>
    <tr class='tableheader'>
    <TD><b><center>#</center></b></TD>
    <TD><b><center>Winner </center></b></TD>
    <TD><b><center>time</center></b></TD>
    <TD><b><center>item</center></b></td>
    <tr class='tablerow'>
            <TD>".$v["id"]."</TD>
            <TD><a href='".WEBSITE."/index.php/character/view/".$result['name'].'">'.$result['name']."</a></TD>
            <TD>".$v["name"]."</TD>
            <TD>" . date("d/m/y  H:i:s", $v["start"]) . "</TD>
            <TD>" . date("d/m/y  H:i:s", $v["time"]) . "</TD>
        </TR>
        </TABLE>
    ";
    }
}

?>
    </div>
</div>

TABLE
Code:
CREATE TABLE IF NOT EXISTS `zombieevent` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `started` int(10) NOT NULL,
  `time` int(10) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;


please let me know if I wrote it is illegal to delete

regards
 
try this
PHP:
<div class='message'>
        <div class='title'>Zombie event</div>
        <div class='content'>
        <?PHP
require("config.php");
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = $ots->getDBHandle();
echo '<table border="0" cellspacing="1" cellpadding="5" width=100% class="cellspadding">
    <center><img src="'.WEBSITE.'/public/images/zombie.png" width="50%" height="50%"/></center><br/>
    <tr class="tableheader">
    <TD align="center">En que consiste Zombie Event?</TD>
    </TR>
    </TABLE> 
    <table border="0" cellspacing="1" cellpadding="5" width=100% class="cellspadding">
            <tr class="tablerow"> 
                <TD width="30%"> 
                    <center><b>Objective</b><br />¿De que trata el zombie evento.</center> 
                </TD> 
                <TD width="70%"> 
                    <center>Todos los días a las 17:00  <b>5pm </b>, se abrira un teleport en el templo por unos minutos,y luego se cerrara..</center> 
                </TD> 
            </TR> 
            <tr class="tablerow"> 
                <TD width="30%"> 
                    <center><b>Desarrollo del evento</b><br />Zombie Plague events</center> 
                </TD> 
                <TD width="70%"> 
                    <center>Una vez cerrado el teleport, pasado unos segundos comenzaran a convocarse un Zombie cada 20 segundos y se informara cuantos zombies hay en la zona del evento y cuantos players vivos Se necesitaran al menos 5 players para que comience el evento y un maximo de 100 players.La idea es escapar de los Zombies, ya que si nos matan, perderemos el evento, el ultimo que muera, como se dijo anteriormente, gana.Es importante notar que al morir, no perderan nada, solo seran descalificados del evento...</center> 
                </TD> 
            </TR>
            <tr class="tablerow"> 
                <TD width="30%"> 
                    <center><b>Que es un zombie?</b><br />Beneficios?</center> 
                </script></strong></span><br/>  ' . $record['score'] . '</a></td><td><img src="'.WEBSITE.'/public/images/zombie2.gif">
                </td></tr> 
                <TD width="70%"> 
                    <center>Un zombie es un mounstruo invulnerable que camina muy lento pero ataca mucho y el beneficio una medalla vip..</center> 
                </TD> 
            </TR> 
        </TABLE> 
        
        <br /><br />';


$zombie = $SQL->query("
    SELECT w.id AS id, w.time AS time, g.name AS evento, p.name AS name, w.started AS start
        FROM zombie AS w
    INNER JOIN players AS p
        ON p.id = w.breaker
    INNER JOIN evento AS g
    ORDER BY id DESC LIMIT 10;    
")->fetchAll();

if(empty($zombie)) {
    echo '
    <table border="0" cellspacing="0" cellpadding="5" width="100%" class="cellspadding">
    <tr class="tableheader">
    <TD align="center">Jugador ganador</TD>
    </TR>
    <tr class="tablerow">
    <td align="center">No ahy ganadores.</td>
    </tr>
    </TABLE>
    ';
} 
else 
{
foreach ($zombie as $k=>$v) {
    echo "<table border='0' cellspacing='1' cellpadding='5' width=100% class='cellspadding'>
    <tr class='tableheader'>
    <TD><b><center>#</center></b></TD>
    <TD><b><center>Winner </center></b></TD>
    <TD><b><center>time</center></b></TD>
    <TD><b><center>item</center></b></td>
    <tr class='tablerow'>
            <TD>".$v["id"]."</TD>
            <TD><a href='".WEBSITE."/index.php/character/view/".$result['name'].'">'.$result['name']."</a></TD>
            <TD>".$v["name"]."</TD>
            <TD>" . date("d/m/y  H:i:s", $v["start"]) . "</TD>
            <TD>" . date("d/m/y  H:i:s", $v["time"]) . "</TD>
        </TR>
        </TABLE>
    ";
    }
}

?>
    </div>
</div>
 
Code:
 A PHP Error was encountered

Severity: Notice

Message: Undefined variable: record

Filename: pages/zombieevent.php

Line Number: 33

Code:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'g.name' in 'field list'' in C:\xampp\htdocs\system\pages\zombieevent.php:51 Stack trace: #0 C:\xampp\htdocs\system\pages\zombieevent.php(51): PDO->query('?? SELECT w....') #1 C:\xampp\htdocs\system\application\controllers\p.php(13): include('C:\xampp\htdocs...') #2 [internal function]: p->v('zombieevent') #3 C:\xampp\htdocs\system\codeigniter\CodeIgniter.php(236): call_user_func_array(Array, Array) #4 C:\xampp\htdocs\index.php(165): require_once('C:\xampp\htdocs...') #5 {main} thrown in C:\xampp\htdocs\system\pages\zombieevent.php on line 51

this errors
:/
 
Back
Top