data from parent table
- baudwalker
- Veteran Member
- Posts: 188
- Joined: 2015-02-03 08:08
- Location: Bellingen NSW Australia
data from parent table
is it possible to get the actual data from the parent table instead of the ID
Re: data from parent table
You'd need to do a join query .. something like this:
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.
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}'")
AppGini plugins to add more power to your apps:
- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.
- baudwalker
- Veteran Member
- Posts: 188
- Joined: 2015-02-03 08:08
- Location: Bellingen NSW Australia
Re: data from parent table
I must be getting old!!, what file are you referring to?
Barry
Barry
Re: data from parent table
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.
AppGini plugins to add more power to your apps:
- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.