I can’t seem to find to how to assign a database query field value to a session, I got this far as to create the session name, but don’t see where I can bind a field to it.
All I see in properties below in my screenshot is a Linked Field area, which I expected to have something to click to the right of it to see queries etc… to click on, see the field in the query and bind it, but maybe I’m just not on the right track for this.
What are the steps I need to do this?
In classic asp all I need to do after a queryis something like the following:
Session(“session_first”) = (rsUser.Fields.Item(“first_name”).Value)
You query the database and then repeat through each of the rows that are returned by the query. In that repeat you can do anything you want for each of those items.
Now, what I do when I only expect a single row to be returned, is I bypass the repeat all together like this:
Thanks, I have that part working where I can access the logged in user data. But I need to display certain data in other pages so to avoid re accessing the database I wanted to set a few sessions once a user is logged in so i can access those session values in other pages.
I think you are conflating user sessions from the server and sessions on the client…they are distinct and separate. If you want to display this on the client, you can just set to Output on the query itself, which will then be available to bind at the client. If you really are in need of session stuff…take a look at the docs for an explanation.
Sometimes the hardest part of Wappler is letting go of old habits and embracing a new way of working.
But if you really need to do this then your syntax {{session_first}} wont work, you need to reference a server session in app connect via scripting i.e. <?php echo $_SESSION["session_first"];?> but frankly just returning values from a server action a much better way