insanelyBlog/includes/settings.class.php

32 lines
548 B
PHP

<?php
class settings
{
public function __construct() {}
public static function getdata()
{
global $_sql;
$_set = array();
$set = $_sql->query("SELECT * FROM settings");
while ($data = $set->fetch_assoc())
$_set[$data['variable']] = $data['value'];
return $_set;
}
public function update($var, $val)
{
global $_sql, $_set;
if (isset($_set[$var]) && $_sql->query("UPDATE `settings` SET `value` = '".sqlprot($val)."' WHERE `variable` = '".$var."'"))
return true;
return false;
}
}