This topic is locked

change parameter in SQL view stored proc and reload list

11/4/2021 11:51:13 PM
PHPRunner General questions
M
MikeT author

Let's say I have a list page based on a stored procedure that takes initial parameters.
On the list page I'd have a button or maybe a dropdown etc, that, after clicking (button) or selecting a value (dropdown) should rerun the query for the list and show the result thet the stored procedure returns with the new parameters.

What's the best approach? I thought about storing initial parameters in session vars and then modifying somehow these session vars and rerun the list page SQL (which is the stored proc, of course).
I mostly asking about how to rerun the underlying stored procedure with new parameters from the list page.

Sorry, if this is too obvious, I'm quite new at SQL-views and hadn't done a phpr project in >1 year.

Thanks!

M
MikeT author 11/5/2021

the session var approach would work, I think (did a small test):

Upon login store some default parameters for the stored proc in a session var. On first open of the list page the stored proc will use those parameters.
Then on the list page based on the SQL-View (stored proc), e.g. in a button:

before event: empty
server code: $_SESSION["my_param"] = someValue
after code: pageObj.reload({a:'reload'});

Don't know if there's a better solution or a more phpr-way ?

admin 11/5/2021

The session variable approach and a reload in ClientAfter event sounds reasonable to me.

M
MikeT author 11/5/2021