From: Davide Franco Date: Wed, 6 Jul 2011 14:26:17 +0000 (+0200) Subject: bacula-web: Fixed pgsql sql query X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0703cd34cc9d8418dc6dc66eb7a0067e41ef3f6f;p=bacula%2Fbacula bacula-web: Fixed pgsql sql query --- diff --git a/gui/bacula-web/includes/bweb.inc.php b/gui/bacula-web/includes/bweb.inc.php index afb36a6525..4bde0788a1 100644 --- a/gui/bacula-web/includes/bweb.inc.php +++ b/gui/bacula-web/includes/bweb.inc.php @@ -541,7 +541,7 @@ class Bweb extends DB $this->TriggerDBError( "Unable to get Job Bytes from catalog", $result ); }else{ $stored_bytes = 0; - $tmp = $result->fetchRow( DB_FETCHMODE_ASSOC ); + $tmp = $result->fetchRow(); $day = date( "D d", strtotime($end_date) ); @@ -582,7 +582,7 @@ class Bweb extends DB $this->TriggerDBError("Unable to get Job Bytes from catalog", $result ); }else{ $stored_bytes = 0; - $tmp = $result->fetchRow( DB_FETCHMODE_ASSOC ); + $tmp = $result->fetchRow(); $day = date( "D d", strtotime($end_date) ); @@ -604,13 +604,13 @@ class Bweb extends DB { case 'sqlite': case 'mysql': - $query = "SELECT SUM(JobFiles),EndTime as stored_bytes FROM Job "; + $query = "SELECT SUM(JobFiles),EndTime as stored_files FROM Job "; $query .= "WHERE ( EndTime BETWEEN '$start_date' AND '$end_date' ) AND "; $query .= "Name = '$jobname'"; $query .= "GROUP BY EndTime"; break; case 'pgsql': - $query = "SELECT SUM(jobfiles),endtime as stored_bytes FROM job "; + $query = "SELECT SUM(jobfiles),endtime as stored_files FROM job "; $query .= "WHERE ( endtime BETWEEN timestamp '$start_date' AND timestamp '$end_date' ) AND "; $query .= "name = '$jobname'"; $query .= "GROUP BY EndTime"; @@ -623,7 +623,7 @@ class Bweb extends DB $this->TriggerDBError("Unable to get Job Files from catalog", $result); }else{ $stored_bytes = 0; - $tmp = $result->fetchRow( DB_FETCHMODE_ASSOC ); + $tmp = $result->fetchRow(); $day = date( "D d", strtotime($end_date) ); $stored_files = $tmp['stored_files'];