From f3e9670cfd29190fcf8832ab19b4dae00e53458f Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 27 Aug 2007 19:44:53 +0000 Subject: [PATCH] Revert get_col behavior. Props mdawaffe. fixes #4826 git-svn-id: https://develop.svn.wordpress.org/trunk@5950 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 09461f2bc6..19c92f5182 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; }