Model basic CRUD methods and other queries on other tables using $this->db->table() |
I'm having what looks to me like a bug.
I have a model configured like this: PHP Code: protected $table = 'sottoeventi'; Here are a number of methods that use CRUDs to execute various queries on the table set in $table. but in certain situations I need to run queries on other tables before or after, so, in the specific case I have this kind of situation: PHP Code: // More code By doing so, however, I receive an error from the second query, that of update on the model table ($table) There is no data to update. If I modify the query using the table() function like this: PHP Code: $this->db->table('sottoeventi')->where('id', (int)$id_sottoevento) everything works I tried printing the $this->table variable, before and after the first query, but the value is correct. At this point, I would expect the query to work normally when I update like this: PHP Code: $this->where('id', (int)$id_sottoevento) Didn't I understand? or is there something wrong? |
Welcome Guest, Not a member yet? Register Sign In |