Welcome Guest, Not a member yet? Register   Sign In
Number of rows deleted from database (activerecords)
#2

[eluser]mddd[/eluser]
num_rows is to find the number of rows in a select statement.
To find the number of affected rows in 'write' type statements, use affected_rows.
This is a query you do to the database, not to the query result. So use:

Code:
$this->db->where($conditions)->delete('mytable');
return $this->db->affected_rows();


Messages In This Thread
Number of rows deleted from database (activerecords) - by El Forum - 05-05-2010, 01:14 AM
Number of rows deleted from database (activerecords) - by El Forum - 05-05-2010, 01:16 AM
Number of rows deleted from database (activerecords) - by El Forum - 05-05-2010, 01:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB