- 01
 - 02
 - 03
 - 04
 - 05
 - 06
 - 07
 - 08
 - 09
 - 10
 - 11
 
                        public function save()
    {
        $query = "SELECT * FROM `users` WHERE `id` = '$this->userId'";
        $result = $this->db->select($query);
        if (!empty($result)) {
            $query = "UPDATE `users` SET `email` = '$this->email', `password` = '$this->pass', `name` = '$this->name', `age` = '$this->age', `date_birth` = '$this->dateBirth', `sex` = '$this->sex', `aboute` = '$this->about' WHERE `id` = '$this->userId'";
        } else {
            $query = "INSERT INTO `users` VALUES('$this->userId','$this->email','$this->pass','$this->name','$this->age','$this->dateBirth','$this->sex','$this->about')";
        }
        $this->db->query($query);
    }
                                 
        
// как всегда ваш .....
как было сказано выше, REPLACE не обновляет индексы, а это плохо.
здесь нужен
INSERT INTO ...
ON DUPLICATE UPDATE ...