WordPress.org

Make WordPress Core

Changeset 5950


Ignore:
Timestamp:
08/27/07 19:44:53 (7 years ago)
Author:
ryan
Message:

Revert get_col behavior. Props mdawaffe. fixes #4826

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/wp-db.php

    r5861 r5950  
    308308        if ( $query ) 
    309309            $this->query($query); 
    310         else 
    311             return null; 
    312  
    313         if ( !$this->last_result ) 
    314             return null; 
    315  
    316         $i = 0; 
    317         foreach( $this->last_result as $row ) { 
    318             $arr = array_values( (array) $row ); 
    319             $new_array[$i] =  $arr[0]; 
    320             $i++; 
     310 
     311        $new_array = array(); 
     312        // Extract the column values 
     313        for ( $i=0; $i < count($this->last_result); $i++ ) { 
     314            $new_array[$i] = $this->get_var(null, $x, $i); 
    321315        } 
    322316        return $new_array; 
Note: See TracChangeset for help on using the changeset viewer.