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

Simple relationship display info.

posted by MikeyC343 6 years ago

I have two tables. Table1 has records with id and a description column. Tables2 has stored the id of table1 as a foreign key. What I would like to do is simply display: table1.description where table1.id = table2.table1_id but using florish methods. I just can't seem to wrap my head around how to do this.

If the tables has a relation you can do this

// $id is the value for the key, with that you create a new object
$objTable1 = new TableOne($id);
$objTable2 = $objTable1->createTableTwo('table1_id');

echo $objTable2->prepareDescription();

If you provide the DDL I can give you the proper example.

posted by jmtucu 6 years ago