Model basic CRUD methods and other queries on other tables using $this->db->table() |
(02-22-2023, 03:06 AM)kenjis Wrote: When you use table('table_name'), you are using a new Query Builder instance directly. Yes, I know this, this is the problem right here, because if I don't use table() of the query builder, the query fails? The Model has its own table set, and the query in question should use that table "sottoeventi". Code: protected $table = 'sottoeventi'; In the specific case I first run other queries with the query builder, use different tables than the model one, then use table('other_table'). PHP Code: $this->db->table('sottoeventi_personale')->where('id_sottoevento', (int)$id_sottoevento)->delete(); The update query returns the error "There is no data to update", while you expect it to update the "sottoeventi" table, which is the Model |
Welcome Guest, Not a member yet? Register Sign In |