Does anyone have an example of code they have used in their "Before Edit" PHP section of a form? I am trying to wrap my head around how to use this feature in my situation, but I have brain lock and need a sharp kick in the imagination.
What I am trying to do is to programmatically set up a temp table to be used in a browse form. Also hoping for a hint on how to use a stored MySQL procedure as part of the solution.
TIA
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Using Before Edit PHP Code Example
Re: Using Before Edit PHP Code Example
tonyd,
I hope this helps.
Steven
I hope this helps.
Code: Select all
nuRunQuery("CREATE TABLE #TABLE_ID# SELECT * FROM aaa");
nuRunQuery("UPDATE #TABLE_ID# SET field00 = 'hello'");
Steven
You do not have the required permissions to view the files attached to this post.
-
- Posts: 68
- Joined: Sun Mar 04, 2018 6:38 pm
Re: Using Before Edit PHP Code Example
Are you suggesting I use a hash cookie for the table name?
TonyD
-
- Posts: 68
- Joined: Sun Mar 04, 2018 6:38 pm
Re: Using Before Edit PHP Code Example
Ok, cool. I got the browse form to load. Unfortunately, when I click on one of its rows I get the edit form but with all blank fields except for the subforms, which seem to have populated just fine. Any ideas?
TonyD
Re: Using Before Edit PHP Code Example
tonyd,
You'll need to make sure the Primary Key is the correct field in your temp table.
This is what takes you to the correct record.
Steven
You'll need to make sure the Primary Key is the correct field in your temp table.
This is what takes you to the correct record.
Steven
You do not have the required permissions to view the files attached to this post.
-
- Posts: 68
- Joined: Sun Mar 04, 2018 6:38 pm
Re: Using Before Edit PHP Code Example
After some head scratching I finally got it to work after separating my BROWSEEDIT form into a unique BROWSE and EDIT form. Also had to add the primary key column to my select statement.
One question remains...Do I need to perform any housekeeping like dropping #TABLE_ID# before opening the EDIT form?
Thanks for all the help!
One question remains...Do I need to perform any housekeeping like dropping #TABLE_ID# before opening the EDIT form?
Thanks for all the help!
TonyD