beginner question August 08, 2020, 06:22:15 PM Im trying to make a field called account a global variable so I can use it later.I put this in the after view form of that record, but no luck.. can any please point me in the right direction. I want to store the account number of the file called customer to a global variable to use later... <?php $val = $modeldata['account']; function display() { GLOBAL $val; }?> Quote Selected
Re: beginner question Reply #1 – August 09, 2020, 03:49:19 PM @nightcasters you can use session (set_session("name", "value"), get_session("name"), and clear_session("name")) or cookies (set_cookie("name", "value"), get_cookie("name"), and clear_cookie("name")) to store values and retrieve them on any page, please referer to the View Helper at the top right corner of the phprad application. Quote Selected Last Edit: August 09, 2020, 03:55:15 PM by willvin
Re: beginner question Reply #2 – December 18, 2020, 09:21:42 AM Thanks willvin.But how can I refer to values that I just retrieved from the db and are now visible on the screen?Isn’t there a general approach to address these values?For example if a view page of a record from a table called: customers with fields called: id, name, city.Is there something like $table.field or $table[1] that we can use? Quote Selected
Re: beginner question Reply #3 – December 18, 2020, 04:44:25 PM @Erwin there are different ways of access data depending on where you are getting the data and where you want to use it. Please provide more info on what you mean, thanks. Quote Selected
Re: beginner question Reply #4 – December 21, 2020, 01:44:19 PM Thank you @willvin, I tried following this post https://phprad.com/forum/index.php?topic=401.0 You showed passing on $data['example'] in that post about a year ago, but I cannot find the recordID field on Page Design.What I want is this:Client has many orders. On page I show client info plus a subpage with list view of the orders.I want to add a new order for that particular client (so not having to lookup the client but preselecting it).Then order is added, modal is closed and client view is refreshed and the list of orders shows the old orders plus the order just placed. Quote Selected