Display records from another table within tablename_dv()

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
JRuacho
Posts: 1
Joined: 2015-06-01 03:05

Display records from another table within tablename_dv()

Post by JRuacho » 2015-06-01 03:40

For the life of me I just can't get this to work, I'm not sure what I'm doing wrong(I'm not good with php) since there are several potential solutions here in the forum and I have tried them all to no avail. Any help will be greatly appreciated!

I have two tables, Designs and Changes(designID,changetext) , trough hooks I managed to store into Changes any updates to any fields made in the Designs table.
Any change in Designs(before update hook) creates an entry in Changes (eg. John has changed the value of Price from 200 to 300).

I plan to use Designs_dv() to show the changes made to that particular Design on the bottom of the page but I don't know how to loop through the results so that it shows all the changes, the records on Changes are like this:

| designID | changetext |
24 John has changed the value of Price from 200 to 300
24 John has changed the value of Production days from 3 to 5

Any ideas on how to query the database so that it pulls all records from Changes that match designID and just spit them out in a loop?

Post Reply