I searched a lot but could not find a way to dump table relations like one-to-one, one-to-many vs in PHP.
Is there a way to handle this issue in PHP?
A result might be:
array(
'tableA' => array(
'one-to-one' => array('tableB', 'tableC'),
'one-to-many' => array('tableD'),
'tableB' => array(
'one-to-one' => array('tableA')
...
)
Any suggestions are much appreciated.
You have to do this yourself by parsing the output of the DESCRIBE command. You might consider using a ORM like doctrine. You tell doctrine to make a one to one relation on table a and table b and it handles the rest.