Action for each record

  1. GET parameter’s name have nothing to do with the name of your database fileds(columns) name.

I just told you to make it so POST and GET variable have different names…
You can name your GET parameter idviag for example (and of course check the bindings to much this name)

  1. in your query the condition is wrong… Change the name in condition

I have to be off for 1 hour… So, check it and we continue later

OK now action

It looks like you’re using the Server Connect component on the page to call this. That component ONLY uses GET parameters. On the API file, remove the POST ones and make sure all of your queries and steps only point to GET parameters or results from queries.

2 Likes

This?

1 Like

Yes,

The results?

Schermata 2023-07-09 alle 10.30.10

Have you changed the parameter name on button click sc. Load (idviaggio)?

the SC is this
Schermata 2023-07-09 alle 10.34.54

No
Show us the button click event.
You call the server connect load.
What is the input parameter there?

IDviaggio…

Server connect looks for idviaggio

Check these two values must much.

Sorry, my mistake let me check what is going on…

Please after the server connect load action add a notification and show this IDviaggio value… What the notification shows?

As you can see from the screenshot select the value from the Repeat table

Sorry
Where should I add a notification?
In the action, in the SC or in the button?

I can’t understand where I have to insert a notification

on button click event.
After the sc load.
I would just like to see what the content of the table IDviaggio is

But I can’t find how to insert a notification

You have to add the compnent into your page but lets forget about it for a moment…

I would like to start from scratch so I can understand what exactly is going on.

You have a table in your page that lists records (tableRepeat2). Your primary key in ths table is IDviaggio and there are some other fields + a button that triggers the “sc_update_viaggio” ServeConnect.

Now in “sc_update_viaggio” SC you have a GET input idviaggio and 2 POST inputs posti & cani.
You update your table’s fields posti & cani (filtered by the GET idviaggio value).

Now back in your page, when you click a tableRepeat’s button, you send that row’s IDviaggio value as a GET input idviaggio to “sc_update_viaggio” SC to update the table data.

Am I right?

Question…
The 2 POST inputs posti & cani where are they getting data from?
Are you sure they have data or are just empty fields?

I have a “VIAGGIl” MySQL table where the data are already entered, which are listed correctly on the page
For each record, the two fields that interest me are “posti” and “cani” and the button I added
Then I have a second MySQL “BIGLIETTI” table that contains in addition to other data the two fields that interest me “posti” and “CANI”
On the page the records "BIGLIETTI"are displayed with a query
The goal by clicking on the button of a record VIAGGI is that :
Change in the record POSTI.value and CANI.value by subtracting the value the corresponding POSTI and CANI from BIGLIETTI
Also modify a field of the BIGLIETTI table with a value from a data on the page
Then link to another page

I hope I have described well
Now I’m out for half an hour

Let me help…

In your “sc_update_viaggio” SC add 2 setvalue actions and set the value from the 2 POST inputs and tick the output option in order to see when you click the button what are the values of these 2 inputs
(for example, name inp1= setvalue($_POST.cani) & inp2= setvalue($_POST.posti)