• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Windows Need help with MySQL

Wezc

Banned User
Joined
Feb 9, 2009
Messages
467
Reaction score
14
Location
Svenneland
Yo, can anyone create a table out of this?

PHP:
SELECT `id`, `title`, `body`, `time` FROM `news` ORDER BY id DESC LIMIT 10

i get this error when i try to enter my website using XAMPP and Modern Aac

PHP:
A Database Error Occurred
Error Number: 1146

Table 'theforgottenserver.news' doesn't exist

SELECT `id`, `title`, `body`, `time` FROM `news` ORDER BY id DESC LIMIT 10
 
SQL:
CREATE TABLE IF NOT EXISTS `news` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(64) NOT NULL DEFAULT '',
  `body` text NOT NULL,
  `time` int(18) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
 
EDIT!: Fixed it..

Sorry for double post,

I got a new error when i tried to log in, it seems like the page_access doesn't exist in the field list
 

Attachments

Last edited by a moderator:
SQL:
ALTER TABLE `accounts` ADD `page_access` int(11);
ALTER TABLE `accounts` ADD `page_lastday` int(11);
ALTER TABLE `accounts` ADD `email_new` varchar(255);
ALTER TABLE `accounts` ADD `email_new_time` int(15);
ALTER TABLE `accounts` ADD `rlname` varchar(255);
ALTER TABLE `accounts` ADD `location` varchar(255);
ALTER TABLE `accounts` ADD `created` int(16);
ALTER TABLE `accounts` ADD `email_code` varchar(255);
ALTER TABLE `accounts` ADD `next_email` int(11);
ALTER TABLE `accounts` ADD `premium_points` int(11);
ALTER TABLE `players` ADD `old_name` varchar(255);
ALTER TABLE `players` ADD `hide_char` int(11);
ALTER TABLE `players` ADD `worldtransfer` int(11);
ALTER TABLE `players` ADD `created` int(16);
ALTER TABLE `players` ADD `nick_verify` int(11);
ALTER TABLE `players` ADD `comment` text;
ALTER TABLE  `accounts` CHANGE  `key`  `key` VARCHAR( 128 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT  '';
ALTER TABLE `accounts` ADD `nickname` char(48);
ALTER TABLE `forums` ADD `guild` int(11) unsigned DEFAULT NULL;
UPDATE accounts SET `key` = '';
ALTER TABLE accounts ADD avatar char(48);
ALTER TABLE accounts ADD about_me text;
UPDATE players SET hide_char = 0;
SQL:
CREATE TABLE IF NOT EXISTS `comments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `news_id` int(11) DEFAULT NULL,
  `body` text NOT NULL,
  `time` int(18) NOT NULL DEFAULT '0',
  `author` varchar(64) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `forums` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(64) NOT NULL,
  `description` text NOT NULL,
  `access` int(5) unsigned NOT NULL,
  `closed` int(1) unsigned NOT NULL COMMENT 'Min. access to see the board',
  `guild` int(11) unsigned DEFAULT NULL,
  `moderators` text NOT NULL,
  `order` int(6) DEFAULT NULL,
  `requireLogin` int(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `posts` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(64) NOT NULL,
  `text` text NOT NULL,
  `time` int(16) unsigned NOT NULL,
  `author` varchar(64) NOT NULL,
  `board_id` int(16) unsigned NOT NULL,
  `thread_id` int(16) unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `threads` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(64) NOT NULL,
  `sticked` tinyint(1) unsigned NOT NULL,
  `closed` tinyint(1) unsigned NOT NULL,
  `author` varchar(64) NOT NULL,
  `time` int(12) unsigned NOT NULL,
  `board_id` int(12) unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `bugtracker` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `category` int(3) unsigned NOT NULL,
  `time` int(16) unsigned NOT NULL,
  `author` int(16) unsigned NOT NULL,
  `text` text NOT NULL,
  `title` varchar(64) NOT NULL,
  `done` int(3) unsigned NOT NULL,
  `priority` int(3) unsigned NOT NULL,
  `closed` int(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `videos` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `author` int(12) unsigned NOT NULL,
  `title` varchar(64) NOT NULL,
  `description` text NOT NULL,
  `youtube` varchar(45) NOT NULL,
  `views` int(12) unsigned NOT NULL,
  `time` int(16) unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `video_comments` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `author` int(12) unsigned NOT NULL,
  `video` int(12) unsigned NOT NULL,
  `time` int(16) unsigned NOT NULL,
  `text` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `messages` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `from` int(12) DEFAULT NULL,
  `to` int(12) DEFAULT NULL,
  `title` varchar(64) NOT NULL,
  `text` text NOT NULL,
  `time` int(16) unsigned NOT NULL,
  `delete_from` int(1) unsigned NOT NULL,
  `delete_to` int(1) unsigned NOT NULL,
  `unread` int(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `friends` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `with` int(11) DEFAULT NULL,
  `friend` int(11) DEFAULT NULL,
  `time` int(16) DEFAULT NULL,
  `active` int(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `poll` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `question` varchar(150) DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `date_start` datetime DEFAULT NULL,
  `date_end` datetime DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `question` (`question`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

CREATE TABLE IF NOT EXISTS `poll_answer` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `poll_id` int(11) NOT NULL,
  `answer` varchar(150) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `poll_id` (`poll_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

CREATE TABLE IF NOT EXISTS `poll_votes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `answer_id` int(11) DEFAULT NULL,
  `poll_id` int(11) DEFAULT NULL,
  `account_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `poll_id` (`poll_id`),
  KEY `account_id` (`account_id`),
  KEY `answer_id` (`answer_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

ALTER TABLE `poll_answer`
  ADD CONSTRAINT `poll_answer_ibfk_1` FOREIGN KEY (`poll_id`) REFERENCES `poll` (`id`);

ALTER TABLE `poll_votes`
  ADD CONSTRAINT `poll_votes_ibfk_1` FOREIGN KEY (`answer_id`) REFERENCES `poll_answer` (`id`),
  ADD CONSTRAINT `poll_votes_ibfk_2` FOREIGN KEY (`poll_id`) REFERENCES `poll` (`id`),
  ADD CONSTRAINT `poll_votes_ibfk_3` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`);
 
SQL:
SELECT `id`, `rlname`, `location`, `about_me`, `nickname` FROM `accounts` WHERE `accounts`.`id` = 3;
 
Back
Top