PMA\libraries\DatabaseInterface::setVariable PHP Méthode

setVariable() public méthode

Sets new value for a variable if it is different from the current value
public setVariable ( string $var, string $value, mixed $link = null ) : boolean
$var string variable name
$value string value to set
$link mixed mysql link resource|object
Résultat boolean whether query was a successful
    public function setVariable($var, $value, $link = null)
    {
        $link = $this->getLink($link);
        if ($link === false) {
            return false;
        }
        $current_value = $this->getVariable($var, self::GETVAR_SESSION, $link);
        if ($current_value == $value) {
            return true;
        }
        return $this->query("SET " . $var . " = " . $value . ';', $link);
    }