Welcome Guest, Not a member yet? Register   Sign In
What's the best way to determine if two tables were updated successfully using Active Record?
#6

[eluser]mddd[/eluser]
On "select" type queries, the query object is returned. That's how you can chain it with result methods:
Code:
$this->db->get('table')->result();
On "write/update/delete" type queries, true or false is returned, indicating the succesful execution.

Note: this does NOT necessarily mean the database was altered. Consider this query:
Code:
update table set status='active' where id=10
As long as the table exists and it has a field 'active' this will always return true. Even if there is no record with id=10. So in this case you would have to check db->affected_rows() to be sure the database really changed.


Messages In This Thread
What's the best way to determine if two tables were updated successfully using Active Record? - by El Forum - 08-27-2010, 02:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB