• 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 problem with database?

qwarcik

New Member
Joined
Nov 24, 2017
Messages
7
Reaction score
0
mysql_real_query(): INSERT INTO `game_logins` SET `id` = NULL, `user` = 9956747, `login` = 'qwa', `password` = 'qwa123', `character_name` = 'Qwa', `character_id` = '7', `level` = '937', `ip_address` = '159.205.22.132', `date` = '1531918851'; - MYSQL ERROR: Table 'ots.game_logins' doesn't exist (1146)



i have this problem in console so what i need to create on my mysql base?
 
Solution
Execute these queries to import the table you're looking for;
SQL:
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
CREATE TABLE `game_logins` (
  `id` int(11) NOT NULL,
  `user` int(11) NOT NULL,
  `login` varchar(64) NOT NULL,
  `password` varchar(256) NOT NULL,
  `character_name` varchar(32) NOT NULL,
  `character_id` int(11) NOT NULL,
  `level` int(11) NOT NULL,
  `ip_address` varchar(16) NOT NULL,
  `date` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE `game_logins` ADD PRIMARY KEY (`id`);
ALTER TABLE `game_logins` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;

Reconsider there points;
1. User stores the same value as login?
2. Why would you store both the...
Execute these queries to import the table you're looking for;
SQL:
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
CREATE TABLE `game_logins` (
  `id` int(11) NOT NULL,
  `user` int(11) NOT NULL,
  `login` varchar(64) NOT NULL,
  `password` varchar(256) NOT NULL,
  `character_name` varchar(32) NOT NULL,
  `character_id` int(11) NOT NULL,
  `level` int(11) NOT NULL,
  `ip_address` varchar(16) NOT NULL,
  `date` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE `game_logins` ADD PRIMARY KEY (`id`);
ALTER TABLE `game_logins` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;

Reconsider there points;
1. User stores the same value as login?
2. Why would you store both the character ID and name, this is redundant
3. Why would you ever store the user/(plain)password apart from the account table
 
Solution
Execute these queries to import the table you're looking for;
SQL:
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
CREATE TABLE `game_logins` (
  `id` int(11) NOT NULL,
  `user` int(11) NOT NULL,
  `login` varchar(64) NOT NULL,
  `password` varchar(256) NOT NULL,
  `character_name` varchar(32) NOT NULL,
  `character_id` int(11) NOT NULL,
  `level` int(11) NOT NULL,
  `ip_address` varchar(16) NOT NULL,
  `date` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE `game_logins` ADD PRIMARY KEY (`id`);
ALTER TABLE `game_logins` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;

Reconsider there points;
1. User stores the same value as login?
2. Why would you store both the character ID and name, this is redundant
3. Why would you ever store the user/(plain)password apart from the account table

Just a tip: that transaction is not needed because database definition language (DDL) statements like "CREATE" are auto-committed.

More info here: PHP: PDO::beginTransaction - Manual (second paragraph).
 
Code:
mysql_real_query(): SELECT `guild_name` FROM `castle` WHERE `owner` > 0 - MYSQL ERROR: Table 'ots.castle' doesn't exist (1146)


Code:
 mysql_real_query(): UPDATE `uptime` SET `time` = 0 - MYSQL ERROR: Table 'ots.uptime' doesn't exist (1146)

Code:
 Table 'ots.uptime' doesn't exist (1146)
[12:52:11.296] mysql_real_query(): UPDATE `players` SET `onlinetime`=players.onlinetime+60 WHERE `online` = 1; - MYSQL ERROR: Unknown column 'onlinetime' in 'field list' (1054)


Code:
mysql_real_query(): INSERT INTO `report` (`id`, `user_id`, `report_id`, `player`, `pos_x`, `po             s_y`, `pos_z`, `date` , `report` , `status` , `ip`) VALUES (NULL, 9956747, '9956747180479', 'Qwarcikk', 76, 6             4, 7, 1532010978, 'zzzzzzz\n' , '0' , '159.205.22.132') - MYSQL ERROR: Unknown column 'user_id' in 'field lis             t' (1054)
 
Last edited:
Back
Top