public getVariable ( string $var, integer $type = self::GETVAR_SESSION, mixed $link = null ) : mixed | ||
$var | string | mysql server variable name |
$type | integer | DatabaseInterface::GETVAR_SESSION | DatabaseInterface::GETVAR_GLOBAL |
$link | mixed | mysql link resource|object |
Результат | mixed | value for mysql server variable |
public function getVariable($var, $type = self::GETVAR_SESSION, $link = null)
{
$link = $this->getLink($link);
if ($link === false) {
return false;
}
switch ($type) {
case self::GETVAR_SESSION:
$modifier = ' SESSION';
break;
case self::GETVAR_GLOBAL:
$modifier = ' GLOBAL';
break;
default:
$modifier = '';
}
return $this->fetchValue('SHOW' . $modifier . ' VARIABLES LIKE \'' . $var . '\';', 0, 1, $link);
}