protected function _safe($table, $array) {
		if (!isset($this->cache[$table])) {
			$this->connect();
			
			$query = "SHOW COLUMNS FROM `$table`";
			if ($this->config['driver'] == 'sqlite') {
				$query = 'PRAGMA table_info(`'.$table.'`);';
			}
			$sth = $this->prepare($query);
			$sth->execute();
			$result = $sth->fetchAll(\PDO::FETCH_ASSOC);
			
			foreach ($result as $row) {
				if ($this->config['driver'] == 'sqlite') {
					$columns[] = $row['name'];
				} else {
					$columns[] = $row['Field'];
				}
			}
			$this->cache[$table] = $columns;
		}
		
		// remove all not existent keys
		foreach (array_keys($array) as $key) {
			if (!in_array($key, $this->cache[$table])) unset ($array[$key]);
		}
		
		return $array;
	}