function variable_exists

7.x db.inc variable_exists($name)
6.x db.inc variable_exists($name)

Returns TRUE or FALSE if the variable exists in the variables table.

1 call to variable_exists()
variable_get_for_school in includes/db.inc
Get a value for a particular school. if bool_ignore_override is TRUE, then we won't worry if it's being overwritten or not.

File

includes/db.inc, line 862
This file contains mostly db shortcuts.

Code

function variable_exists($name) {
  if (isset($GLOBALS ["fp_system_settings"][$name])) {
    return TRUE;
  }

  $count = intval(db_result(db_query("SELECT COUNT(name) as my_count 
                     FROM variables
                     WHERE name = ?", array($name))));

  if ($count > 0) {
    return TRUE;
  }

  // else....
  return FALSE;

}