function DatabaseHandler::get_variable

7.x DatabaseHandler.php DatabaseHandler::get_variable($name, $default_value = "")
6.x DatabaseHandler.php DatabaseHandler::get_variable($name, $default_value = "")

Retrieve a value from the variables table.

Parameters

string $name:

File

classes/DatabaseHandler.php, line 987

Class

DatabaseHandler

Code

function get_variable($name, $default_value = "") {
  $res = $this->db_query("SELECT value FROM variables
                           WHERE name = ? ", $name);
  $cur = $this->db_fetch_array($res);

  $val = $cur ["value"];
  if ($val == "") {
    $val = $default_value;
  }

  return $val;
}