mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-02 05:31:25 +01:00
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:
parent
27f66be1cd
commit
7aa077d6a0
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user