by using SSI.php i am accessing user's list of forums. suppose i have 3 registered users in my forums user1, user2, user3
require('SSI.php');
global $context, $settings, $options, $scripturl, $txt;
file_get_contents($context);
$username = $context['user']['name'];
in my php code i am using those user names to get information via api url.
$api = "hxxps://apiurl/?account_id=$username";
$json = file_get_contents($api);
$array = json_decode($json, true);
here i am retriving some data from api.
$data1 = $array[data1];
$data2 = $array[data2];
for now i am doing below task individually for every member from specific group in Simple Machine Forums.
include 'config.php';
$query = mysql_query("SELECT username FROM table1 WHERE username=$username", $con);
if (mysql_num_rows($query) != 0){
mysql_query("INSERT INTO my inset query)") or die (mysql_error());
echo "User's New Record added<br> ";
}
my question is how can i automatically update all members record by giving it a list of array which contains all usernames and how can i create corn job that this specific php file run automatically after every 24 hours. i am using mysql i have seen around mysql is not safe but as i am just beginner please ignore my mistakes i am trying to understand basics.