A more elegant way of doing get_col.
git-svn-id: https://develop.svn.wordpress.org/trunk@5861 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
91a88550f1
commit
3b8b2a649a
@ -310,9 +310,14 @@ class wpdb {
|
||||
else
|
||||
return null;
|
||||
|
||||
// Extract the column values
|
||||
for ( $i=0; $i < count($this->last_result); $i++ ) {
|
||||
$new_array[$i] = $this->get_var(null, $x, $i);
|
||||
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++;
|
||||
}
|
||||
return $new_array;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user