mirror of
git://develop.git.wordpress.org/
synced 2025-04-26 15:13:30 +02:00
In wpdb::load_col_info()
, don't fetch the number of fields in the result row on each iteration of the for
loop. It can be stored in a var and referenced.
See #32444. git-svn-id: https://develop.svn.wordpress.org/trunk@32515 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
6f4e407208
commit
6378cb5d60
@ -2893,11 +2893,13 @@ class wpdb {
|
||||
return;
|
||||
|
||||
if ( $this->use_mysqli ) {
|
||||
for ( $i = 0; $i < @mysqli_num_fields( $this->result ); $i++ ) {
|
||||
$num_fields = @mysqli_num_fields( $this->result );
|
||||
for ( $i = 0; $i < $num_fields; $i++ ) {
|
||||
$this->col_info[ $i ] = @mysqli_fetch_field( $this->result );
|
||||
}
|
||||
} else {
|
||||
for ( $i = 0; $i < @mysql_num_fields( $this->result ); $i++ ) {
|
||||
$num_fields = @mysql_num_fields( $this->result );
|
||||
for ( $i = 0; $i < $num_fields; $i++ ) {
|
||||
$this->col_info[ $i ] = @mysql_fetch_field( $this->result, $i );
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user