From: Davide Franco Date: Tue, 7 Dec 2010 11:01:13 +0000 (+0100) Subject: bacula-web: Fixed bug with fetchmode in bweb.inc.php X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=88ba90fe1d83c9139e96d559a888271166d3b985;p=bacula%2Fbacula bacula-web: Fixed bug with fetchmode in bweb.inc.php --- diff --git a/gui/bacula-web/bweb.inc.php b/gui/bacula-web/bweb.inc.php index 4c968212f7..248207748d 100644 --- a/gui/bacula-web/bweb.inc.php +++ b/gui/bacula-web/bweb.inc.php @@ -254,13 +254,13 @@ class Bweb extends DB { // Get the list of pools id $query = "SELECT Pool.poolid, Pool.name FROM Pool ORDER BY Pool.poolid"; - $this->db_link->setFetchMode(DB_FETCHMODE_ASSOC); + //$this->db_link->setFetchMode(DB_FETCHMODE_ASSOC); $pools = $this->db_link->query( $query ); if( PEAR::isError( $pools ) ) die("Error: Failed to get pool list
SQL Query: $query
" . $pools->getMessage() ); - while( $pool = $pools->fetchRow() ) { + while( $pool = $pools->fetchRow( DB_FETCHMODE_ASSOC ) ) { switch( $this->driver ) { case 'mysql': @@ -290,7 +290,7 @@ class Bweb extends DB { break; } // end switch - $this->db_link->setFetchMode(DB_FETCHMODE_ASSOC); + //$this->db_link->setFetchMode(DB_FETCHMODE_ASSOC); $medias = $this->db_link->query( $query ); if( PEAR::isError( $medias ) ) { @@ -303,7 +303,7 @@ class Bweb extends DB { { $volumes[ $pool['name'] ] = array(); } - while( $media = $medias->fetchRow() ) { + while( $media = $medias->fetchRow( DB_FETCHMODE_ASSOC ) ) { if( $debug ) { var_dump( $media ); } @@ -554,7 +554,7 @@ class Bweb extends DB { if( PEAR::isError( $result ) ) { die("Unable to get volume number from catalog"); }else{ - $nb_vol = $result->fetchRow(); + $nb_vol = $result->fetchRow(DB_FETCHMODE_ASSOC); return array( $pool_name, $nb_vol['nb_vol'] ); } }