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

Solved Search character name error !

Daniel Kopeć

Member
Joined
Dec 8, 2018
Messages
125
Solutions
4
Reaction score
12
Location
Poland
I get this error when searching for a player with a name that does not exist :(

how to fix it?

PHP:
Fatal error: Uncaught exception 'E_OTS_NotLoaded' in C:\xampp\htdocs\pot\OTS_Player.php:1808 Stack trace: #0 C:\xampp\htdocs\characters.php(66): OTS_Player->getCustomField('id') #1 C:\xampp\htdocs\index.php(101): include('C:\xampp\htdocs...') #2 {main} thrown in C:\xampp\htdocs\pot\OTS_Player.php on line 1808

Where could the code be invalid?

pot/OTS_player.php: line 1808>>>

PHP:
public function getCustomField($field)
    {
        if( !isset($this->data['id']) )
        {
            throw new E_OTS_NotLoaded();     [B]<<<line1808[/B]
        }

        $value = $this->db->query('SELECT ' . $this->db->fieldName($field) . ' FROM ' . $this->db->tableName('players') . ' WHERE ' . $this->db->fieldName('id') . ' = ' . $this->data['id'])->fetch();
        return $value[$field];

characters.php: line66>>>

PHP:
if($config['site']['show_vip_status'])
                        {
                         $id = $player->getCustomField("id");  [B]<<<line 66[/B]
                                if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
                           $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=10%>Vip Status:</TD>';
                         $vip = $SQL->query('SELECT * FROM player_storage WHERE player_id = '.$id.' AND `key` = '.$config['site']['show_vip_storage'].';')->fetch();
                           if($vip == false) {
                            $main_content .= '<TD><font color="red"><B>NOT VIP</B></font></TD></TR>';
                            }
                            else

indes.php: line 101>>>

PHP:
case "characters";
        $topic = "Characters";
        $subtopic = "characters";  [B] <<<line 101[/B]
        include("characters.php");
 

WibbenZ

Global Moderator
Staff member
Global Moderator
Joined
Oct 16, 2008
Messages
6,360
Solutions
228
Reaction score
1,442
Location
Sweden
Solution
Top