This topic is locked
[SOLVED]

 Setting date picker value with a query

6/30/2017 2:35:32 PM
PHPRunner General questions
D
digger68 author

I am wanting to run a query using the logged in users ID as input to get a date value from the locally connected MySql database. Then I want to use this value to set the value on a date picker control. I have validated my query is working through navicat and understand how to access the $values["UserID"] varable to get the user. I just haven't found a good example where and how to update the date picker control using a query result. I assuming it is on page load. A little lost and looking for some direction.

Sergey Kornilov admin 6/30/2017

You can execute your query in BeforeProcess event of the page in question and ave result in some session variable. Then use this session variable as a default value of your date field.

D
digger68 author 6/30/2017

Thanks for the quick reply. I am looking for the page to load and be presented to the user with the value from the query setting the value on the date picker. I am thinking the before process happens as the form is submitted. Am I mistaken?

Sergey Kornilov admin 6/30/2017
D
digger68 author 7/2/2017



You are mistaken. Check this:

https://xlinesoft.com/phprunner/docs/page_life_cycle_overview.htm


So simple thanks for pointing me in the right direction.