WP_Debug_Data::get_mysql_var() – Returns the value of a MySQL system variable.

You appear to be a bot. Output may be restricted

Description

Returns the value of a MySQL system variable.

Usage

$string|null = WP_Debug_Data::get_mysql_var( $mysql_var );

Parameters

$mysql_var
( string ) required – Name of the MySQL system variable.

Returns

string|null The variable value on success. Null if the variable does not exist.

Source

File name: wordpress/wp-admin/includes/class-wp-debug-data.php


Lines:

1 to 15 of 15
  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;
  }
 

 View on GitHub View on Trac