public function saveConfig($key, $value) { $db = new MainDB(); $conn = $db->getConnection(); $stmt = $conn->prepare(self::$UPDATE); $stmt->bindValue(':value', $value); $stmt->bindValue(':key', $key); $stmt->execute(); $error = $stmt->errorInfo(); }
public static function getInstance() { if (!self::$mainDataStore) { self::$mainDataStore = new MainDB(); return self::$mainDataStore; } return self::$mainDataStore; }
public function __construct() { self::$db = MainDB::getInstance(); }
public function executeAttributeQuery($attributes, $colValuePair, $isApplyFilter = false) { foreach ($colValuePair as $key => $value) { if ($value != '') { $query_array[] = $key . ' = ' . "'" . $value . "'"; } } $columns = implode(", ", $attributes); $query = "SELECT " . $columns . " FROM " . $this->tableName . " WHERE " . implode(" AND ", $query_array); if ($isApplyFilter) { $query = FilterUtil::applyFilter($query, false); } $db = MainDB::getInstance(); $conn = $db->getConnection(); $sth = $conn->prepare($query); $sth->execute(); //$this->throwException($sth->errorInfo()); $objList = $sth->fetchAll(); return $objList; }