while ($res = $db->fetchArray()) { if ($res['type'] == 0) { $amount = ChangetoMili($res['amount'], $currency); $r = $api->Transfer($res['wallet'], $amount, $currency, 'Withdrawal'); // Payment memo if ($r['result'] == APIerror::OK) { $batchno = $r['value']; $db2->query("update tbl_withdrawal set status=1,reccode='{$batchno}' where withdrawal_id='" . $res['withdrawal_id'] . "'"); echo "Withdrawal has been proceessed" . $res['withdrawal_id']; } } else { $db2->queryres("select * from tbl_user where user_id='" . $res['user_id'] . "'"); $address = $db2->res['address']; $amount = ChangetoMili($res['amount'], $currency); if ($currency == 'mBTC') { $r = $api->TransferBTC($address, $amount, 'mBTC', 'Withdrawal'); } if ($currency == 'mLTC') { $r = $api->TransferLTC($address, $amount, 'mLTC', 'Withdrawal'); } if ($currency == 'mDRK') { $r = $api->TransferDRK($address, $amount, 'mDRK', 'Withdrawal'); } if ($currency == 'mPPC') { $r = $api->TransferPPC($address, $amount, 'mPPC', 'Withdrawal'); } if ($currency == 'mDOGE') { $r = $api->TransferDOGE($address, $amount, 'mDOGE', 'Withdrawal'); } if ($r['result'] == APIerror::OK) { $batchno = $r['value'];