Call to undefined method Builder::affectedRows() |
in the documentation - affectedRows();
Quote:Displays the number of affected rows, when doing “write” type queries (insert, update, etc.).My code: PHP Code: // Method in model Call to undefined method CodeIgniter\\Database\\MySQLi\\Builder::affectedRows() Please tell me what I'm doing wrong.
This is how it works. Not very logical. If you work with Query Builder Class, then these methods should also be there, at least you can just make a mistake. And this also applies to the method -> insertID ()
You're right !
An other solution is : the method update() should return FALSE if failure and the number of affected rows if success The signature of the method would be : public function update($withAffectedRows = FALSE) It's better with a parameter because we don't always want the number of affected rows and it costs a query ... My mistake, the method affectedRows() doesn't perform a database query ... |
Welcome Guest, Not a member yet? Register Sign In |