What's new

Inne Problem ze zrobieniem gracza.

Status
Not open for further replies.

Siwy1993

Advanced User
Joined
Apr 23, 2009
Messages
176
Reaction score
0
Witam mam aveste pod 7.6 account number zrobi?em, zapisa?em i jest okej, ale gdy robie nowego player'a wyskakuje. Co robie ?le, co mo?e by? przyczyn? ?
B??d
Zapytanie SQL: Edytuj Edytuj


INSERT INTO `players` (`id`, `name`, `account_id`, `group_id`, `sex`, `vocation`, `experience`, `level`, `maglevel`, `health`, `healthmax`, `mana`, `manamax`, `manaspent`, `direction`, `looktype`, `lookhead`, `lookbody`, `looklegs`, `lookfeet`, `posx`, `posy`, `posz`, `cap`, `lastlogin`, `lastlogout`, `lastip`, `save`, `redskulltime`, `redskull`, `guildnick`, `loss_experience`, `loss_mana`, `loss_skills`, `loss_items`, `rank_id`, `town_id`, `balance`, `status`) VALUES ('1', 'Dzikus', '1', '5', '0', '0', '0', '1', '0', '100', '100', '100', '100', '0', '0', '136', '10', '10', '10', '10', '160', '54', '7', '0', '0', '0', '0', '1', '0', '0', '', '10', '10', '10', '10', '', '', '0', '0'), ('2', 'Chuj', '2', '5', '0', '0', '0', '1', '0', '100', '100', '100', '100', '0', '0', '136', '10', '10', '10', '10', '160', '54', '7', '0', '0', '0', '0', '1', '0', '0', '', '10', '10', '10', '10', '', '', '0', '0')
MySQL zwr?ci? komunikat: Dokumentacja

#1452 - Cannot add or update a child row: a foreign key constraint fails (`avesta`.`players`, CONSTRAINT `players_ibfk_2` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`))
 

Placek

Blue Waffle
Joined
Sep 30, 2008
Messages
6,793
Reaction score
672
Age
9
Odp: Problem ze zrobieniem gracza.

Starasz sie dodac gracza z group_id o wartosci 5. To znaczy, ze musi istniec grupa w tabeli group o id 5. Jesli takiej nie ma to dostajesz wlasnie taki blad dotyczacy foreign key.
Mozesz tez wylaczyc sprawdzanie tego, ale czy na pewno chcesz? xP
 
Status
Not open for further replies.
Top