使用PHP和CodeIgniter在数据库中对价目表进行折扣

I have a view with a form to input a percentage of discount/rise and apply it to a list of products stored in a table of a database, here is the code of the controller which I explain below:

    $rise = 1+$this->input->post('rise')/100;
    $this->db->where('client',$this->session->userdata('id_client'));
    $query = $this->db->get('products');

    foreach ($query->result() as $row){

        $price = array(
            'price' => $row->price*$rise
        );
        $this->db->where('id',$row->id);
        $this->db->update('products',$price);

    }

    redirect('site/select_client');

First set the rise, then get from the products table all the ones that correspond to the client that we are working on (stored as session variable), an for each one set the array to update and update in for the product that has the corresponding id. (the table has the columns id, client, name and price). After that it should redirect to another controller.

It shows no error but no changes are made on the database.

I modified your code, please use this and check. it will work correctly.
$rise = $this->input->post('rise')/100;
$this->db->where('client',$this->session->userdata('id_client'));
$query = $this->db->get('products');

foreach ($query->result() as $row){

      $price=$row->price + ($row->price * $rise);

    $price = array(
        'price' => $price
    );
    $this->db->where('id',$row->id);
    $this->db->update('products',$price);

}