Buy Now
Sign in

Read data from different tables

vismay , March 04 2018
vismay 206
March 04 2018 #375845
Hi, I would like to read data from different table that have a certain relation.
The final result must be a table that shows values from different table related with a certain value.,,, model4.group_id
read data from "content" where model1.catid:8
ok easy.
This read_data function has a second model,
get "email" from "houses tab" where foreign key from "content" is "alias" with condition model1.alias:model2.hotel
ok, i retrive
from now on doesn't work anymore.
get "id" from "user" where foreign key from "houses tab" is "email" with condition
doesn't work
I would like to go further:
get "user_group" from "user_group_map" where foreign key from "user" is "id" with condition
In attachment the screenshot.
admin 25.9
March 25 2018 #376404
Hi vismay,
You need to use either the foreign key or the "Relation conditions", in case you use the foreign key then the foregn key value should match the "primary key" value on the related model.
Best regards
If your main question got answered then please mark the answer using the button!
Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!