I've 2 tables users (id is primary key) and user_content (id2 is primary) both of them smallint (6) and I wanna make foreign key so everything from user_content links to particular user (id i.e.) so I tried this
but I ge this error
(both tables exists)
PHP Code:
ALTER TABLE `user_content`
ADD CONSTRAINT `FK_id`
FOREIGN KEY (`id2`) REFERENCES `users(id)`
ON UPDATE CASCADE
ON DELETE CASCADE ;
PHP Code:
#1005 - Can't create table 'skusobna.#sql-12db_9f' (errno: 150)