• 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 Localhost (mysql_real_query(): INSERT INTO `guild_invites` (`player_id`, `guild_id`)

Status
Not open for further replies.

Celsish

New Member
Joined
Apr 6, 2009
Messages
74
Reaction score
0
mysql_real_query(): INSERT INTO `guild_invites` (`player_id`, `guild_id`) VALUES (34, 6) - MYSQL ERROR: Cannot add or update a child row: a foreign key constraint fails (`OTmap`.`guild_invites`, CONSTRAINT `guild_invites_ibfk_2` FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE) (1452)


How do I fix??
 
Code:
CREATE TABLE `guild_invites`
(
	`player_id` INT NOT NULL DEFAULT 0,
	`guild_id` INT NOT NULL DEFAULT 0,
	UNIQUE (`player_id`, `guild_id`),
	FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE,
	FOREIGN KEY (`guild_id`) REFERENCES `guilds`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;
 
Status
Not open for further replies.
Back
Top