⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

set_relation in 4 tables related to the same id? Help



Mauistar

Mauistar
  • profile picture
  • Member

Posted 07 November 2017 - 12:49 PM

Hi i have 4 tables

 

USER, ACCESS, EMAIL, PHONE

 

USER

usr_id (PK)

name

adress

 

ACCESS

acc_id (PK)

username

passsword

usr_id (FK)

 

EMAIL

eml_id (PK)

email

usr_id (FK)

 

PHONE

ph_id (PK)

phone

usr_id (FK)

 

and I want to show all the data of the USER table, besides the data username (ACCESS) email (EMAIL) phone (PHONE)

 

help please.. greetings from Chile

 

 


Amit Shah

Amit Shah
  • profile picture
  • Member

Posted 07 November 2017 - 17:35 PM

Well there are 2 ways to it - either you create your own model where u provide your custom query - or there is a crude way around -create number of extra columns required, make column callback - fecth the relevant values and display it.

 

Happy GCing :)


Mauistar

Mauistar
  • profile picture
  • Member

Posted 07 November 2017 - 18:04 PM

Tks Amit, Can you show me an example of that callback? I'm not a professional in code.


Mauistar

Mauistar
  • profile picture
  • Member

Posted 07 November 2017 - 18:04 PM

Well there are 2 ways to it - either you create your own model where u provide your custom query - or there is a crude way around -create number of extra columns required, make column callback - fecth the relevant values and display it.

 

Happy GCing :)

Tks Amit, Can you show me an example of that callback? I'm not a professional in code.