CWT Posted April 20, 2023 Share Posted April 20, 2023 I use a RAD called PHPRunner to build Database Applications. One of the snippets of code I use a lot is to insert a Field Value from a Master Table into an equivalent Field in a Child Table as a "Before Add Event", is as follows: - global $dal; $tblDetail = $dal->Table("tblUserRequests"); $tblDetail->Value["ID"] = $data["ID"]; $tblDetail->Param["ID"] = $data["ID"]; $tblDetail->Update(); unset($data["ID"]); What I would like is help from someone to modify this code so that I can insert 2 or more Field Values in the same operation. So as well as inserting the Value "ID" into the Child Table I can also insert the Value "client". Many thanks for reading. Carl. Quote Link to comment https://forums.phpfreaks.com/topic/316165-code-modification-required/ Share on other sites More sharing options...
ginerjm Posted April 20, 2023 Share Posted April 20, 2023 I think you would need to modify the Update function to achieve your wish. What you are showing us is the setup steps only. The Update function would need a change to accept a new parameter and a change to the query that gets run by Update to accomodate a new setup field. Have at it! Quote Link to comment https://forums.phpfreaks.com/topic/316165-code-modification-required/#findComment-1607528 Share on other sites More sharing options...
CWT Posted April 21, 2023 Author Share Posted April 21, 2023 Error handling is taken care of by my RAD. I am merely seeking a derivation of the above to handle more than one value. Quote Link to comment https://forums.phpfreaks.com/topic/316165-code-modification-required/#findComment-1607558 Share on other sites More sharing options...
ginerjm Posted April 21, 2023 Share Posted April 21, 2023 What are you saying? Who is talking about 'error handling'? If you want to do some change to accomodate an additional update to a record it sounds to me like the update function needs a change to handle that. Quote Link to comment https://forums.phpfreaks.com/topic/316165-code-modification-required/#findComment-1607560 Share on other sites More sharing options...
cyberRobot Posted April 21, 2023 Share Posted April 21, 2023 @CWT - How familiar are you with coding in PHPRunner? It sounds like you need a loop (e.g., foreach, while). If you haven't worked with loops before, I'm sure there's some documentation you could look through. Note that I haven't used PHPRunner before. So I don't have any specific code for you. Quote Link to comment https://forums.phpfreaks.com/topic/316165-code-modification-required/#findComment-1607561 Share on other sites More sharing options...
CWT Posted April 22, 2023 Author Share Posted April 22, 2023 @cyberRobot Not very to be honest but thank you for suggestion I will explore that option. Quote Link to comment https://forums.phpfreaks.com/topic/316165-code-modification-required/#findComment-1607602 Share on other sites More sharing options...
Solution CWT Posted April 25, 2023 Author Solution Share Posted April 25, 2023 I have decided to pursue a different option utilizing Session Variables. Quote Link to comment https://forums.phpfreaks.com/topic/316165-code-modification-required/#findComment-1607689 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.