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

Trying to vote on a poll but getting error

Minimii

New Member
Joined
Dec 3, 2008
Messages
749
Reaction score
3
Location
Sweden, Piteå
When I try to vote on a poll I get this error
PHP:
Fatal error: Call to a member function fetch() on a non-object in C:\xampp\htdocs\pot\OTS_Account.php on line 371
This is line 371 in OTS_Account.php
PHP:
$value = $this->db->query('SELECT ' . $this->db->fieldName($field) . ' FROM ' . $this->db->tableName('accounts') . ' WHERE ' . $this->db->fieldName('id') . ' = ' . $this->data['id'])->fetch();

I also get this error when im trying to make a new thread in the forum
PHP:
Fatal error: Call to a member function fetchAll() on a non-object in C:\xampp\htdocs\forum.php on line 202

This is line 202 in forum.php
PHP:
		$threads = $SQL->query("SELECT `players`.`name`, `players`.`account_id`, `players`.`world_id`, `players`.`rank_id`, `players`.`vocation`, `players`.`promotion`, `players`.`level`, `z_forum`.`id`,`z_forum`.`first_post`, `z_forum`.`section`,`z_forum`.`post_text`, `z_forum`.`post_topic`, `z_forum`.`post_date`, `z_forum`.`post_smile`, `z_forum`.`author_aid`, `z_forum`.`author_guid`, `z_forum`.`last_edit_aid`, `z_forum`.`edit_date` FROM `players`, `z_forum` WHERE `players`.`id` = `z_forum`.`author_guid` AND `z_forum`.`first_post` = ".(int) $thread_id." ORDER BY `z_forum`.`post_date` LIMIT ".$posts_per_page." OFFSET ".($page * $posts_per_page))->fetchAll();
Im very thankful for all the help you can give me =)
 
Do you have the forum table in your database? (z_forum)
If not, create it.

Code:
CREATE TABLE `z_forum` (
  `id` int(11) NOT NULL auto_increment,
  `first_post` int(11) NOT NULL default '0',
  `last_post` int(11) NOT NULL default '0',
  `section` int(3) NOT NULL default '0',
  `replies` int(20) NOT NULL default '0',
  `views` int(20) NOT NULL default '0',
  `author_aid` int(20) NOT NULL default '0',
  `author_guid` int(20) NOT NULL default '0',
  `post_text` text NOT NULL,
  `post_topic` varchar(255) NOT NULL,
  `post_smile` tinyint(1) NOT NULL default '0',
  `post_date` int(20) NOT NULL default '0',
  `last_edit_aid` int(20) NOT NULL default '0',
  `edit_date` int(20) NOT NULL default '0',
  `post_ip` varchar(32) NOT NULL default '0.0.0.0',
  PRIMARY KEY  (`id`),
  KEY `section` (`section`)
) ENGINE=MyISAM AUTO_INCREMENT=1 ;
 
Back
Top