Let us say I'm making a phone book.
class Friends
- ->FirstName
- ->LastName
- ->City
- ->State
- ->ZIP
- ->Phone
From what I understand it would be best practice for me to have two tables in my database though for something like this with FirstName, LastName, Phone in one and the Address info in a separate table then use a ForeignKey to connect them. This way if two friends live in the same address I'm not repeating any information.
Should I be setting the class up with an INNER JOIN query then?
I haven't settled on a framework at this point so if you could also tell me:
In CakePHP would I be able to use the INNER JOIN to create a class or would that go against convention? If not would I be better served using a different framework like Laravel, Zend, Yii, Symfony or CodeIgniter instead?
A person could have multiple locations say a company for example that has two different offices, or a friend that has a summer and winter home.