Jump to content


set_relation in 4 tables related to the same id? Help

set_relation

  • Please log in to reply
3 replies to this topic

#1 Mauistar

Mauistar

    Newbie

  • Members
  • Pip
  • 4 posts

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

 

 



#2 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

Posted 07 November 2017 - 05: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 :)



#3 Mauistar

Mauistar

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 07 November 2017 - 06:04 PM

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



#4 Mauistar

Mauistar

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 07 November 2017 - 06: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.







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users