A more elegant way of doing get_col.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5b82b1c426
commit
c13a667443
|
@ -310,9 +310,14 @@ class wpdb {
|
||||||
else
|
else
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
// Extract the column values
|
if ( !$this->last_result )
|
||||||
for ( $i=0; $i < count($this->last_result); $i++ ) {
|
return null;
|
||||||
$new_array[$i] = $this->get_var(null, $x, $i);
|
|
||||||
|
$i = 0;
|
||||||
|
foreach( $this->last_result as $row ) {
|
||||||
|
$arr = array_values( (array) $row );
|
||||||
|
$new_array[$i] = $arr[0];
|
||||||
|
$i++;
|
||||||
}
|
}
|
||||||
return $new_array;
|
return $new_array;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue