From a507ac24790c584492b5ce96cd7b4b2291f1ef47 Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Wed, 18 Feb 2015 18:34:57 +0000 Subject: [PATCH] Move the \$now variable to where it is needed --- poll-billing.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/poll-billing.php b/poll-billing.php index 5b70ac552..f02f06e30 100755 --- a/poll-billing.php +++ b/poll-billing.php @@ -50,6 +50,7 @@ function CollectData($bill_id) $port_list = dbFetchRows("SELECT * FROM `bill_ports` as P, `ports` as I, `devices` as D WHERE P.bill_id=? AND I.port_id = P.port_id AND D.device_id = I.device_id", array($bill_id)); print_r($port_list); + $now = dbFetchCell("SELECT NOW()"); foreach ($port_list as $port_data) { $port_id = $port_data['port_id']; @@ -61,8 +62,6 @@ function CollectData($bill_id) $port_data['in_measurement'] = getValue($port_data['hostname'], $port_data['port'], $port_data['ifIndex'], "In"); $port_data['out_measurement'] = getValue($port_data['hostname'], $port_data['port'], $port_data['ifIndex'], "Out"); - $now = dbFetchCell("SELECT NOW()"); - $last_data = getLastPortCounter($port_id,in); if ($last_data['state'] == "ok") {