Welcome Guest, Not a member yet? Register   Sign In
Call to undefined method Builder::affectedRows()
#1

(This post was last modified: 01-03-2020, 12:58 PM by Dedov_Evgeniy.)

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
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;

As a result, I get the error:
Call to undefined method CodeIgniter\\Database\\MySQLi\\Builder::affectedRows()

Please tell me what I'm doing wrong.
Reply


Messages In This Thread
Call to undefined method Builder::affectedRows() - by Dedov_Evgeniy - 01-03-2020, 12:56 PM



Theme © iAndrew 2016 - Forum software by © MyBB