public function save($table, $data, $id = 'id', $auto_id = true)
    {
        // Update
        if (isset($data[$id]) && $this->getFieldById($table, $id, $this->escape($data[$id]), $id) !== false) {
            try {
                return $this->updateById($table, $data, $id);
            } catch (\Exception $e) {
                throw $e;
            }

            // Insert
        } else {
            try {
                if ($auto_id) {
                    unset($data[$id]);
                }
                return $this->insertId($table, $data);
            } catch (\Exception $e) {
                throw $e;
            }
        }
    }