Welcome Guest, Not a member yet? Register   Sign In
db->delete() is failing for some reason...
#2

[eluser]barbazul[/eluser]
I've done some testing and checked the AR code and then I realized that for some reason, when multiple tables are passed in an array, the method simply returns NULL.
check DB_active_rec.php line 1318

so you'll always enter the if in your example.

Maybe there is the need to double check what the desired functionality for this AR method is, but to quickly fix your code use the following:

Code:
$success = TRUE;
foreach ($tables as $t) {
    if (! $this->db->delete($t,array("user_id"=>$user_id))) {
        $success = FALSE;
    }
}
return $success;


Messages In This Thread
db->delete() is failing for some reason... - by El Forum - 04-02-2008, 10:11 PM
db->delete() is failing for some reason... - by El Forum - 04-03-2008, 12:13 AM
db->delete() is failing for some reason... - by El Forum - 04-03-2008, 07:29 AM
db->delete() is failing for some reason... - by El Forum - 04-03-2008, 08:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB