Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

mapping table question.

posted by zeromnil 7 years ago

Given the following schema...

CREATE TABLE IF NOT EXISTS database.table1 ( id INT NOT NULL AUTO_INCREMENT , PRIMARY KEY (id) , ENGINE = InnoDB;

CREATE TABLE IF NOT EXISTS database.table2 ( id INT NOT NULL AUTO_INCREMENT , table1_id INT NOT NULL , table3_id INT NOT NULL , PRIMARY KEY (id) , ENGINE = InnoDB;

CREATE TABLE IF NOT EXISTS database.table3 ( id INT NOT NULL AUTO_INCREMENT , stuff VARCHAR(255) NULL , junk VARCHAR(255) NULL , PRIMARY KEY (id) , ENGINE = InnoDB;

is there a way to prebuild/precreate table3's data with table1? given that table1 and table2 are in a relationship, and table2 and table3 are in a relationship?

e.g. $data = fRecordSet::build('table1'); $data->preBuildTable3();

or something along those lines?

Thanks in advance for the community support!