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

A PHP error was encountered.

arturhaddad

Member
Joined
Aug 14, 2010
Messages
217
Reaction score
8
I have some errors in War of Emperium page script.
I have talked to kito and he said to ask here.
I use windows and modern AAC ( Dream Wars - Woe BUG )

This are the errors:

HTML:
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: SQL

Filename: pages/woebug.php

Line Number: 2

Fatal error: Call to a member function query() on a non-object in C:\xampp\htdocs\system\pages\woebug.php on line 2



Script:


PHP:
<?PHP
$woe = $SQL->query("
    SELECT w.id AS id, w.time AS time, g.name AS guild, p.name AS name, w.started AS start, w.guild AS guild_id
        FROM woe AS w
    INNER JOIN players AS p
        ON p.id = w.breaker
    INNER JOIN guilds AS g
        ON g.id = w.guild
    ORDER BY id DESC LIMIT 10;    
");

foreach ($woe as $k=>$v) {
    $winners .="
        <TR BGCOLOR=\"".$config['site'][($k % 2 == 1 ? 'light' : 'dark').'border']."\">
            <TD>{$v[id]}</TD>
            <TD><a href='index.php?subtopic=guilds&action=show&guild=" . $v[guild_id] . "'>$v[guild]</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>
    ";
}
$main_content .= '
<center><h1>War of Emperium</h1></center>
<br>
INFO HERE
';

if(!$winners) {
    $main_content .= '
        <TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>
            <TR BGCOLOR="'.$config['site']['vdarkborder'].'">
                <TD CLASS=white>
                    <B>Winners of WoE</B>
                </TD>
            </TR>
            <TR BGCOLOR='.$config['site']['darkborder'].'>
                <TD>
                    no WoE in '.$config['server']['serverName'].' yet.
                </TD>
            </TR>
        </TABLE>
    ';
} else {
    $main_content .= "
        <TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>
            <TR BGCOLOR=\"{$config['site']['vdarkborder']}\">
                <TD CLASS=white width=5%>
                    <B>No.</B>
                </TD>
                <TD CLASS=white width=30%>
                    <B>Winner guild</B>
                </TD>
                <TD CLASS=white width=25%>
                    <B>Conquest by</B>
                </TD>
                <TD CLASS=white width=20%>
                    <B>Start time</B>
                </TD>
                <TD CLASS=white width=20%>
                    <B>Last conquest</B>
                </TD>
            </TR>
            $winners
        </TABLE>
    ";
}
?>
 
Last edited:
the script is not original ;p
buy the script original by jano ;)
 
I bought the original script that gave many errors, so kito2 (jano's reseller) told me to use this.
I'll post the main-php-page's error.


~> I EDITED WITH THE ORIGINAL SCRIPT
 
use this :D
PHP:
 <?PHP 
require("config.php");
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = $ots->getDBHandle();

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

$winners = '';

foreach ($woe as $k=>$v) { 
    $winners .=" 
        <TR BGCOLOR=".($k % 2 == 1 ? '#993333' : '#336633')."> 
            <TD>{$v['id']}</TD> 
            <TD><a href='index.php?subtopic=guilds&action=show&guild=" . $v['guild'] . "'>$v[guild]</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> 
    "; 
} 
echo ' 
'; 

if($winners == '') { 
    echo ' 
        <TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%> 
            <TR BGCOLOR="#red"> 
                <TD CLASS=white> 
                    <B>Winners of WoE</B> 
                </TD> 
            </TR> 
            <TR BGCOLOR="#black"> 
                <TD> 
                    There are no WoEs in '.$config['server']['serverName'].' yet. 
                </TD> 
            </TR> 
        </TABLE> 
    '; 
} else { 
    echo " 
        <TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%> 
            <TR BGCOLOR='#3366CC'> 
                <TD CLASS=white width=5%> 
                    <B>No.</B> 
                </TD> 
                <TD CLASS=white width=30%> 
                    <B>Winner guild</B> 
                </TD> 
                <TD CLASS=white width=25%> 
                    <B>Conquest by</B> 
                </TD> 
                <TD CLASS=white width=20%> 
                    <B>Start time</B> 
                </TD> 
                <TD CLASS=white width=20%> 
                    <B>Last conquest</B> 
                </TD> 
            </TR> 
            $winners 
        </TABLE> 
    "; 
} 
?>
 
didnt work for me ): when i put the script and then try to acces it in the web i get this message:
english:
Server error.

The system encountered an error while extracting http://tw.game-over.cl//index.php/p/v/woeb. It is possible that the server is unavailable for maintenance or is not configured properly.

spanish:
Error del servidor.

El sistema encontró un error mientras extraía http://tw.game-over.cl//index.php/p/v/woeb. Es posible que el servidor no esté disponible por mantenimiento o no esté bien configurado.

this is my website http://tw.game-over.cl//index.php/p/v/woeb

any idea? i get the same error when a character tries to leave a guild :(
thanks!
 
no it isnt, the "woe" page is to test if pages are working normally and the "woeb" pages is the real woe script

any idea?
 
Back
Top