6 months ago

Best practice to store and output data

Posted 6 months ago by Tim-KH

I want to have a simple show view for my users. Here I want to output data like this:

Contactinformation: E-Mail: XXXXX, Skype: XXXXX, Phone: XXXXX

General Data: Last Online: XXXX, Birthdate: XXXX, Website: XXXX

Extra informations: Place of residence: XXXX, Comment: XXXXX

I have thought about three different way to achieve this.

  1. Just store all data that belongs to the user in the user table and call it in my view like that $user->email etc...

  2. Store all information in the user table and use my controller to create three different arrays with the correlating data and run a those in a foreach in my view.

  3. Store the Contactinformations, general data and extra informations in a seperat table and connect it with the user table with a one to one relationship.

All these would have the same effect but I would love to know what the best approach to such a thing is.

Please sign in or create an account to participate in this conversation.