Returns the value of a MySQL system variable.
Parameters
$mysql_var
stringrequired- Name of the MySQL system variable.
Source
public static function get_mysql_var( $mysql_var ) {
global $wpdb;
$result = $wpdb->get_row(
$wpdb->prepare( 'SHOW VARIABLES LIKE %s', $mysql_var ),
ARRAY_A
);
if ( ! empty( $result ) && array_key_exists( 'Value', $result ) ) {
return $result['Value'];
}
return null;
}
Changelog
Version | Description |
---|---|
5.9.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.