From 402c170b0b6ea9a2e4a736304e0670427761f9b7 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Wed, 1 Jun 2011 10:21:09 +0000 Subject: [PATCH] fix db update for mac accounting (and enable spitting out sql query on error) git-svn-id: http://www.observium.org/svn/observer/trunk@2386 61d68cd4-352d-0410-923a-c4978735b2b8 --- includes/dbFacile.php | 2 +- includes/polling/cisco-mac-accounting.inc.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/dbFacile.php b/includes/dbFacile.php index 374c7e0cb..7c0d13af7 100644 --- a/includes/dbFacile.php +++ b/includes/dbFacile.php @@ -122,7 +122,7 @@ function dbUpdate($data, $table, $where = null, $parameters = array()) { if(dbQuery($sql, $data)) { $return = mysql_affected_rows(); } else { - #echo("$fullSql"); + echo("$fullSql"); trigger_error('QDB - Update failed.', E_USER_WARNING); $return = false; } diff --git a/includes/polling/cisco-mac-accounting.inc.php b/includes/polling/cisco-mac-accounting.inc.php index 6df305aee..ca093c5e4 100755 --- a/includes/polling/cisco-mac-accounting.inc.php +++ b/includes/polling/cisco-mac-accounting.inc.php @@ -85,7 +85,8 @@ foreach ($acc_rows as $acc) if ($acc['update']) { /// Do Updates - dbUpdate($acc['update'], 'mac_accounting', 'WHERE `ma_id` = ?', array($acc['ma_id'])); + print_r($acc['update']); + dbUpdate($acc['update'], 'mac_accounting', '`ma_id` = ?', array($acc['ma_id'])); } /// End Updates } }