'Separate PHP script in a cron job
I have about 10 accounts. Also, I have a cron job with php script which executes every minute. This script is working for each client one by one.
The problem is that it takes about 16 seconds for 1 account to execute. So, in a result it could take more than 1 minute to finish.
Is that possible to separate PHP script for each customer? Thank you.
for ($i=1; $i <= 5; $i++) {
$sql_du = "SELECT * FROM wptj_users WHERE activebot = '2' AND coinsnum = '${i}'";
$resultd = $conn->query($sql_du);
if ($resultd->num_rows > 0) {
while ($rowas = $resultd->fetch_assoc()) {
// CHECK EACH USER
for ($h=1; $h <= $d; $h++) {
// CHECK EACH COIN
$tableName = "orders" . $h;
$usernamik = $rowas['user_nicename'];
list($userapi, $userkey, $curr, $tgchat, $user_telegramdeals, $user_balance, $finalcoin, $totalqt, $onumber, $n, $ne, $takeprofit, $orderprofit, $profitorderrr, $currcof, $prevcof, $mydeposit, $fullDeposit, $takeProfitDev, $ordernumber, $smartDca, $liveadd, $pullup, $dynamictp) = getUserDetails($usernamik, $tableName);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|