Mohd Izzar
Posts: 0
Joined: Fri Feb 22, 2019 9:28 am

Get data from Mysql

Hi, I'm kinda in a hurry to make this work. So, here is my questions.

I have follow tutorial here on how to get data from mysql:
https://devcenter2.appery.io/tutorial...

Is there a way I can access the data without using the button? I am trying to display data from mysql automatically when user go to Screen1. Trying put the code get in init function does not work for me.

And how to refresh the data every 5 minutes?

I am new to coding. Sorry and thanks!

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Get data from Mysql

Hello Mohd,

Sure, you can run the service on the "page show" event, to execute it right after the page is ready.
If you need to run the service every 5 minutes, please use a JS setInterval function: presetInterval(function(){
myService.execute();
}, 300000);/pre
here "300000" - 5 minutes in ms
"myService" - he name of the service you need to execute every 5 minutes

P.S. That tutorial is outdated, please see the newest one: https://docs.appery.io/docs/apiexpres...

Return to “Issues”