This topic is locked
[SOLVED]

Dynamically change text on Welcome Page - from lookup query

11/26/2023 11:57:29 PM
PHPRunner General questions
C
Craig Smith author

Hello,

I am looking to query a table and return the date that a routine last run.

I would then like to display that date as part of a text string on the menu.php page in my application. - 'Database last updated on 7th November 2023'.

I have looked high an low in the forum but can't find anything - well, at least anything I understand.

Is there a Javascript on load / DBExec call I can make, concatenate a string and then display the string in the menu landing page.

I appreciate any help - even a push in the right direction would be great. I'm not bad with following the tutorials, but this is one I just can't get a start on.

Thanks and regards,
Craig

mbintex 11/27/2023

You can do it with a code snippet placed on any page - the welcome screen also.

The code snippet can query the database with DB::Query or DB::Lookup and then echo the results on the screen where the snippet is placed.

admin 11/27/2023

Code snippet is a way to go. Execute a SQL query and display results on the page.

Dalkeith 11/28/2023

Yes code snippets

Here's a one liner example which tells users what the time on the server is when the list form is opened.

I wanted to indicate to users whether my server was on UTC time or not for international users.

img alt

And this is what it looks like

Example 1
img alt

Example 2 minutes later
img alt

C
Craig Smith author 11/30/2023

Thank you so much everyone - I will try this out tomorrow and get back to you with my results.

I greatly appreciate the feedback.

Best regards,
Craig

C
Craig Smith author 12/3/2023

Hello again,

Thanks to your suggestions, I was able to create exactly what I was after on the main menu page. The solution that worked for me is below:

img alt

The result is here:

img alt

Thanks again for your help. It helped out a lot.

Have a great day!

Best regards,
Craig