﻿--- includes/database/prefetch.inc	2012-05-03 00:10:42.000000000 +0200
+++ includes/database/prefetch.inc	2012-05-08 14:44:46.000000000 +0200
@@ -423,13 +423,17 @@
   }
 
   public function fetchAll($fetch_style = NULL, $fetch_column = NULL, $constructor_args = NULL) {
     $this->fetchStyle = isset($fetch_style) ? $fetch_style : $this->defaultFetchStyle;
     $this->fetchOptions = $this->defaultFetchOptions;
     if (isset($fetch_column)) {
-      $this->fetchOptions['column'] = $fetch_column;
+      if ($fetch_style & PDO::FETCH_COLUMN) {
+          $this->fetchOptions['column'] = $fetch_column;
+      } else if ($fetch_style & PDO::FETCH_CLASS){
+          $this->fetchOptions['class'] = $fetch_column;
+      }
     }
     if (isset($constructor_args)) {
       $this->fetchOptions['constructor_args'] = $constructor_args;
     }
 
     $result = array();
