function do_all_transactions_by_server($server_id, $force = false) { global $db; if ($force) { $sql = 'SELECT * FROM transactions WHERE t_done = 1 AND t_success = 0 AND t_server = ' . $db->check($server_id) . ' ORDER BY t_id ASC'; } else { $sql = 'SELECT * FROM transactions WHERE t_done = 0 AND t_server = ' . $db->check($server_id) . ' ORDER BY t_id ASC'; } if ($result = $db->query($sql)) { while ($t = $db->fetch_array($result)) { do_transaction($t); } } }
function do_transaction_by_id($t_id) { global $db; $sql = 'SELECT * FROM transactions WHERE t_done = 0 AND t_id = ' . $db->check($t_id); if ($result = $db->query($sql)) { if ($t = $db->fetch_array($result)) { return do_transaction($t); } else { return false; } } else { return false; } }