So the product query will always return one record, right? If this is the case, then you can use Single Query for product. However, your record product[0].item_id should also work when using a normal query.
So, you get some data from the product query, here?
It is necessary to check whether the value of $_GET.product is coming to the server. To do this, you can disable both the query step and the insert step. Create a Set Value step (enable its output) and assign it the value $_GET.product. And then open the debugger in Chrome, go to the network tab (Fetch/XHR), and see what the server action returns when you go to page 2.
The problem is that you combine two completely different actions by nature. The first action is to get the data and then display it on the page. It is done by Server Connect on the client side and getting data from database queries. But there should be no insertion steps in such server actions.
If you need to insert data into the database, you need to send this data using the form using the POST method. In the form, you can use any parameters from the page. After that, you will send them to the server and do all the necessary actions, including inserting them into the database.
Initially, I thought that you wanted to send a form to write to the database, and then, when going to page 2, display data from the product table using a filter based on the session variable. However, you only need to make a record. In this case, you do not need to use Server Connect on the page. It is required to use the form and in which you send $_POST.name , $_POST.username, $_POST.password. In the same form, create a hidden product input (on the server side, the value will be in $_POST.product), as Teodor recommended above:
Steven, I may have confused you. I’m sorry, initially I misunderstood your task. Your task is very easy to solve in the Wappler. For a better understanding, I have made a short guide:
Create a form with the necessary inputs. In my case, these are three inputs (inp_f1, inp_f1 and product). The product input is hidden and takes a value equal to the value of the query parameter:
On the server side, in the server action, we create a Single Query step in which we use the value $_POST.product as a filter, which we get from the form: