0
I’m trying to create a Foreign key, but it’s wrong. Follow the code I’m using:
CREATE TABLE foto(
id INT(10),
img varchar(25),
nome varchar(25),
link varchar(25),
vew INT(10),
tkm VARCHAR(100),
moder INT(1),
CONSTRAINT fot_id_pk
PRIMARY KEY (id)
);
CREATE TABLE inter(
id INT(10),
img varchar(25),
nome varchar(25),
link varchar(25),
vew INT(10),
tkm VARCHAR(100),
moder INT(5),
CONSTRAINT int_id_pk
PRIMARY KEY (id),
CONSTRAINT int_moder_fk
FOREIGN key (moder)
REFERENCES foto (moder)
);