mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Database: Set MySQL connection collation.
Fixes #36649. git-svn-id: https://develop.svn.wordpress.org/trunk@37320 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -780,21 +780,19 @@ class wpdb {
|
||||
if ( $this->use_mysqli ) {
|
||||
if ( function_exists( 'mysqli_set_charset' ) && $this->has_cap( 'set_charset' ) ) {
|
||||
mysqli_set_charset( $dbh, $charset );
|
||||
} else {
|
||||
$query = $this->prepare( 'SET NAMES %s', $charset );
|
||||
if ( ! empty( $collate ) )
|
||||
$query .= $this->prepare( ' COLLATE %s', $collate );
|
||||
mysqli_query( $dbh, $query );
|
||||
}
|
||||
$query = $this->prepare( 'SET NAMES %s', $charset );
|
||||
if ( ! empty( $collate ) )
|
||||
$query .= $this->prepare( ' COLLATE %s', $collate );
|
||||
mysqli_query( $dbh, $query );
|
||||
} else {
|
||||
if ( function_exists( 'mysql_set_charset' ) && $this->has_cap( 'set_charset' ) ) {
|
||||
mysql_set_charset( $charset, $dbh );
|
||||
} else {
|
||||
$query = $this->prepare( 'SET NAMES %s', $charset );
|
||||
if ( ! empty( $collate ) )
|
||||
$query .= $this->prepare( ' COLLATE %s', $collate );
|
||||
mysql_query( $query, $dbh );
|
||||
}
|
||||
$query = $this->prepare( 'SET NAMES %s', $charset );
|
||||
if ( ! empty( $collate ) )
|
||||
$query .= $this->prepare( ' COLLATE %s', $collate );
|
||||
mysql_query( $query, $dbh );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user