Revert get_col behavior. Props mdawaffe. fixes #4826

git-svn-id: http://svn.automattic.com/wordpress/trunk@5950 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-08-27 19:44:53 +00:00
parent 27f66be1cd
commit 7aa077d6a0

View File

@ -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;
}