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

bolero

MikeHere
Joined
Apr 13, 2009
Messages
1,146
Reaction score
12
Location
Venezuela
How I can delete all rows of this tables without delete the table called players_killers? ^_^

Help urgent pls.
 
First
SQL:
DROP TABLE IF EXISTS `player_killers`;
and then
SQL:
CREATE TABLE `player_killers`
(
	`kill_id` INT NOT NULL,
	`player_id` INT NOT NULL,
	FOREIGN KEY (`kill_id`) REFERENCES `killers`(`id`) ON DELETE CASCADE,
	FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;
<<REP++>>
 
Ok, this worked, but now I need remove the table called "killers" bro :/

Say this:

SQL:
 DROP TABLE IF EXISTS `killers`;
[Err] 1217 - Cannot delete or update a parent row: a foreign key constraint fails
 
I have navicat for mysql, I delete the table and I can't .. Look

dibujobyp.jpg
 
Drop it manually and then
SQL:
CREATE TABLE `killers`
(
	`id` INT NOT NULL AUTO_INCREMENT,
	`death_id` INT NOT NULL,
	`final_hit` TINYINT(1) UNSIGNED NOT NULL DEFAULT FALSE,
	`unjustified` TINYINT(1) UNSIGNED NOT NULL DEFAULT FALSE,
	PRIMARY KEY (`id`),
	FOREIGN KEY (`death_id`) REFERENCES `player_deaths`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;
 
Now My web doesn't work and the server crash by this:
[16:46:00.743] mysql_real_query(): INSERT INTO `killers` (`death_id`, `final_hit`, `unjustified`, `war`) VALUES (1, 1, 0, 0) - MYSQL ERROR: Cannot add or update a child row: a foreign key constraint fails (`mistic`.`killers`, CONSTRAINT `killers_ibfk_1` FOREIGN KEY (`death_id`) REFERENCES `players_killers` (`id`) ON DELETE CASCADE) (1452)
 
Back
Top