• 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 Mysql error

Mera Mero

Guess Who?
Joined
Dec 27, 2014
Messages
417
Reaction score
86
Hello ,i've got deathlist system and i've sql the query on my phpmyadmin and i found problem with it when i checked the deathlist
QUERY
Code:
CREATE TABLE death_list (
    id          INTEGER NOT NULL,
    player_id   INTEGER NOT NULL,
    date        INTEGER NOT NULL,
    level       INTEGER NOT NULL,
    killer_name INTEGER NOT NULL,
    PRIMARY KEY ( id )
);
and when i check the deathlist found this error
Code:
[28/01/2015 14:15:25] mysql_real_query(): INSERT INTO `death_list` (`player_id`, `date`, `level`, `killer_name`) VALUES ('5', '1422447325', '115', 'Morgaroth. '); - MYSQL ERROR: Duplicate entry '0' for key 'PRIMARY' (1062)
any ideas about it?

yoyo? anyone here?

may someone help me? !
 
Last edited by a moderator:
That table is for SQlite, run this for MySQL.
Drop the old table first:
Code:
DROP TABLE `death_list`;
Then create it again:
Code:
CREATE TABLE `death_list` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `player_id` int(11) NOT NULL,
  `date` bigint(20) unsigned NOT NULL,
  `level` int(11) NOT NULL,
  `killer_name` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB;
 
That table is for SQlite, run this for MySQL.
Drop the old table first:
Code:
DROP TABLE `death_list`;
Then create it again:
Code:
CREATE TABLE `death_list` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `player_id` int(11) NOT NULL,
  `date` bigint(20) unsigned NOT NULL,
  `level` int(11) NOT NULL,
  `killer_name` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB;
thx its working good now :D but what is the difference between them? and how can i change mysql query if it is sqlite?
and i got another problem most time when i open my forgotten console run something happen with it and comes laggy after then not responding after then close automatic ? may i know the reason please?
 
Could be your pc can't handle running your server at that moment, maybe to many things running.
To change a SQLite query to a MySQL query you can use your mysql schema as example, look what is used for ids, normal numbers, big numbers, small numbers, text etc.
 
Could be your pc can't handle running your server at that moment, maybe to many things running.
To change a SQLite query to a MySQL query you can use your mysql schema as example, look what is used for ids, normal numbers, big numbers, small numbers, text etc.
okey thanks honey :p but my pc got 4GB Ram isn't it enough? and when i open my console my cpu ups to 80!! and sometime 100 lol
 
[Error - mysql_real_query] Query: INSERT INTO player_deaths (player_id, time, level, killed_by, is_player) VALUES (1, 1743649284, 132, 'field item', 1)
Message: Field 'mostdamage_by' doesn't have a default value
 

Similar threads

Back
Top