- Beranda
- Komunitas
- Tech
- Programmer Forum
[ASK] error upload data ke db mysql
TS
revolution32
[ASK] error upload data ke db mysql
query
table variation
errornya
mohon bantuannya.
Code:
-- Constraints for table `variation`
--
ALTER TABLE `variation`
ADD FOREIGN KEY (`parent`) REFERENCES `variation` (`id`),
ADD FOREIGN KEY (`scale`) REFERENCES `scale` (`id`),
ADD FOREIGN KEY (`user`) REFERENCES `users` (`user_id`);
--
table variation
Code:
REATE TABLE IF NOT EXISTS `variation` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`parent` bigint(20) DEFAULT NULL,
`scale` bigint(20) DEFAULT NULL,
`value` varchar(255) NOT NULL,
`user` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `parent` (`parent`,`scale`,`value`,`user`),
KEY `scale` (`scale`),
KEY `user` (`user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=101 ;
errornya
Code:
ERROR 1452 (23000) at line 277: Cannot add or update a child row: a foreign key constraint fails (getsy.#sql-f44_2a, CONSTRAINT #sql-f44_2a_ibfk_2 FOREIGN KEY (scale) REFERENCES scale (id))
mohon bantuannya.
0
910
3
Tulis komentar menarik atau mention replykgpt untuk ngobrol seru
Urutan
Terbaru
Terlama
Tulis komentar menarik atau mention replykgpt untuk ngobrol seru
Komunitas Pilihan