Page counter

I have a dynamic page for product detail
I have a field numeric counter in the database and I want automatic increment each time the page is opened
I can do it without problems with PHP but I would like to know if exist a specific command in Wappler

1 Like

Hello,
Add a server action which updates your database table value and run it on page load.

1 Like

Thank you
I did not think about it

Hello @Teodor,
Could you please elaborate on this? I have tried several times (using form with hidden fields) but it does not work…
Thanks!

@Moustapha

Create a server action, which updates your database (no need of form with hidden fields). Then add it on the page and make sure it runs on page load.

Thanks for your reply @Teodor.
I have tried that, but the problem is the database update action creates a $_POST field. How to put the value in that without a form?

Use $_GET variables in the server action instead (just create them manually), and select them as a value for the update.
Then on the page you can assign values to them.

1 Like

Excellent! It is working now perfectly. The $_GET was a trick here.
Thanks a lot @Teodor

1 Like