wpdb::get_charset_collate()publicWP 3.5.0

Retrieves the database character collate.

Method of the class: wpdb{}

No Hooks.

Return

String. The database character collate.

Usage

global $wpdb;
$wpdb->get_charset_collate();

Changelog

Since 3.5.0 Introduced.

wpdb::get_charset_collate() code WP 6.5.2

public function get_charset_collate() {
	$charset_collate = '';

	if ( ! empty( $this->charset ) ) {
		$charset_collate = "DEFAULT CHARACTER SET $this->charset";
	}
	if ( ! empty( $this->collate ) ) {
		$charset_collate .= " COLLATE $this->collate";
	}

	return $charset_collate;
}