Welcome Guest, Not a member yet? Register   Sign In
Model basic CRUD methods and other queries on other tables using $this->db->table()
#12

(02-22-2023, 05:16 AM)kenjis Wrote: There is no data to update" means the model thinks there is no data to update.
If you read the stacktrace and the model code, you can find why there is no data.
I have to transform this


PHP Code:
$this->where('id', (int)$id_sottoevento)
    ->update(
        [
          'data_inizio' => '0000-00-00',
          'data_fine'  => '0000-00-00'
        ]
    ); 

in this


PHP Code:
$this->save(
    [
      'id'          => $id_sottoevento,
      'data_inizio' => '0000-00-00',
      'data_fine'   => '0000-00-00'
    ]
); 

so it works


If instead I want to use update() and not save()


PHP Code:
$this->update(
    $id_sottoevento
    [
      'data_inizio' => '0000-00-00',
      'data_fine'  => '0000-00-00'
    ]
); 

I haven't tested this but it should work


But I still don't understand why the first version doesn't work, it will be my limitation
Reply


Messages In This Thread
RE: Model basic CRUD methods and other queries on other tables using $this->db->table() - by serialkiller - 02-22-2023, 07:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB