From 7aa077d6a0d89a97a790d445a6d974ee354d1204 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 27 Aug 2007 19:44:53 +0000 Subject: [PATCH] Revert get_col behavior. Props mdawaffe. fixes #4826 git-svn-id: http://svn.automattic.com/wordpress/trunk@5950 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/wp-db.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index 09461f2bc..19c92f518 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -307,17 +307,11 @@ class wpdb { function get_col($query = null , $x = 0) { if ( $query ) $this->query($query); - else - return null; - if ( !$this->last_result ) - return null; - - $i = 0; - foreach( $this->last_result as $row ) { - $arr = array_values( (array) $row ); - $new_array[$i] = $arr[0]; - $i++; + $new_array = array(); + // Extract the column values + for ( $i=0; $i < count($this->last_result); $i++ ) { + $new_array[$i] = $this->get_var(null, $x, $i); } return $new_array; }