01-03-2020, 12:56 PM
(This post was last modified: 01-03-2020, 12:58 PM by Dedov_Evgeniy.)
in the documentation - affectedRows();
As a result, I get the error:
Call to undefined method CodeIgniter\\Database\\MySQLi\\Builder::affectedRows()
Please tell me what I'm doing wrong.
Quote:Displays the number of affected rows, when doing “write” type queries (insert, update, etc.).My code:
PHP Code:
// Method in model
function editClient($id = '', $FIELDS = [])
{
$db = $this->db->table('WK_clients');
$db
->where('id', (int)$id)
->update($FIELDS);
$FIELDS['id'] = $id;
return $db->affectedRows() ? $FIELDS : false;
}
Call to undefined method CodeIgniter\\Database\\MySQLi\\Builder::affectedRows()
Please tell me what I'm doing wrong.