Make an insert in two diffent tables

0

hello I have a question about how to make an insert to two different tables with php having foreign key, this in a single form that you have ...

CREATE TABLE validador(id_registro int not null PRIMARY KEY AUTO_INCREMENT,id int not null, FOREIGN KEY (id) REFERENCES usuario (id) on UPDATE CASCADE on DELETE CASCADE);

CREATE TABLE encuesta(id_encuesta int not null PRIMARY KEY AUTO_INCREMENT, id_registro int not null,id int not null, FOREIGN KEY (id_registro) REFERENCES validador(id_registro) on UPDATE CASCADE on DELETE CASCADE,FOREIGN KEY (id) REFERENCES usuario (id) on UPDATE CASCADE on DELETE CASCADE);
    
asked by Pedro185 11.12.2018 в 17:26
source

0 answers