function save($table, $data, $primary_key, $stmt_key = null)
    {
        // Update if primary key exists in data set or insert new row
        if (!empty($data[$primary_key])) {
            return $this->update($table, $data, $primary_key . " = ?", $data[$primary_key], $stmt_key);
        } else {
            return $this->insert($table, $data, $stmt_key);
        }
    }