Welcome Guest, Not a member yet? Register   Sign In
[solved]I have problems to update and delete one row (Ignited record)
#1

[eluser]molistok[/eluser]
Hi,
I don't understand what is my error, can any help me?

I do this in a function of my model 'member_group':

$this->where('user_id',$user_id)->where('group_id',$group_id)->limit(1);
$members=$this->find_all();
foreach($members as $member)
{
$member->joined_at=date('Y-m-d H:iConfused');
$ret=$member->save();
...
}

If I look in my Database, I see that the row aren't updated. And I can see new row. I have checked that the find_all method found the row. Can any help me please?
Thanks.
#2

[eluser]cmark[/eluser]
MMmh

$this->db->where(‘user_id’,$user_id)->where(‘group_id’,$group_id)->limit(1);
$this->db->update('user_id', array("joined_at" => date(‘Y-m-d H:iConfused’) ) );

test with that : )
#3

[eluser]molistok[/eluser]
Hi, thanks for the reply. I am using Ignited record and therfore I want understand because my code don't work. Can any help me?

Thanks.
#4

[eluser]molistok[/eluser]
Hi, I solved the problem. I think that the problem was in the relations of the model. Thanks.




Theme © iAndrew 2016 - Forum software by © MyBB