$databasegetVariable()

Get the value of a MySQL variable

Example

// Get the minimum fulltext index word length
$value = $database->getVariable('ft_min_word_len');
echo $value; // outputs "4"

Usage

// basic usage
$string = $database->getVariable(string $name);

// usage with all arguments
$string = $database->getVariable(string $name, bool $cache = true, bool $sub = true);

Arguments

NameType(s)Description
$namestring

Name of MySQL variable you want to retrieve

$cache (optional)bool

Allow use of cached values? Default:true

$sub (optional)bool

Allow substitution of MyISAM variable names to InnoDB equivalents when InnoDB is engine? Default:true

Return value

string null


$database methods and properties

API reference based on ProcessWire core version 3.0.251