data from parent table

Wish to see a specific feature/change in future releases? Feel free to post it here, and if it gets enough "likes", we'd definitely include it in future releases!
Post Reply
User avatar
baudwalker
Veteran Member
Posts: 98
Joined: 2015-02-03 08:08
Location: Bellingen NSW Australia

data from parent table

Post by baudwalker » 2018-03-13 07:01

is it possible to get the actual data from the parent table instead of the ID

User avatar
a.gneady
Site Admin
Posts: 992
Joined: 2012-09-27 14:46
Contact:

Re: data from parent table

Post by a.gneady » 2018-03-14 09:49

You'd need to do a join query .. something like this:

Code: Select all

$parent_value = sqlValue("select parent_caption_field from parent_table left join child_table on parent_table.id=child_table.lookup_field where child_table.id='{$record_id}'")
Replace parent_caption_field, parent_table, child_table, lookup_field, id with actual names. $record_id is the variable containing the ID of the child record.
:idea: Learn all the tips and tricks of customizing AppGini apps through our online course.

:arrow: Summary Reports plugin enables you to build powerful reports and charts inside your AppGini application through a few simple steps. See the big picture and discover trends in your data that empower you to take the right decisions confidently.

:arrow: Search Page Maker enables you to build user-friendly yet powerful search pages for your AppGini application by simply dragging and dropping the fields you want to include in search.

User avatar
baudwalker
Veteran Member
Posts: 98
Joined: 2015-02-03 08:08
Location: Bellingen NSW Australia

Re: data from parent table

Post by baudwalker » 2018-03-24 03:30

I must be getting old!!, what file are you referring to?

Barry

User avatar
a.gneady
Site Admin
Posts: 992
Joined: 2012-09-27 14:46
Contact:

Re: data from parent table

Post by a.gneady » 2018-03-28 08:41

I didn't mean any specific file in particular. But this should work in any PHP file inside hooks, or for any custom file you add to your AppGini app.
:idea: Learn all the tips and tricks of customizing AppGini apps through our online course.

:arrow: Summary Reports plugin enables you to build powerful reports and charts inside your AppGini application through a few simple steps. See the big picture and discover trends in your data that empower you to take the right decisions confidently.

:arrow: Search Page Maker enables you to build user-friendly yet powerful search pages for your AppGini application by simply dragging and dropping the fields you want to include in search.

Post Reply