Welcome Guest, Not a member yet? Register   Sign In
changing object in loop in Datamapper ORM to save
#6

[eluser]WanWizard[/eluser]
Try to use code blocks, that would make your posts much cleaner. Also, you're answer doesn't answer any of my questions.

Check for errors first
Code:
if ( ! $t->save() )
{
    // or we can loop through the error's all list
    foreach ($t->error->all as $error)
    {
        echo $error;
   }
}

If you say that using $_POST['field'] works, but $this->input->post("$val") doesn't, wouldn't it be obvious that that's where the problem is, and not in the Datamapper code?

For starters, try $this->input->post($var), because I haven't got a clue why you would use double quotes there. Also, you should check if that actually returns a value. If it doesn't exist, the post() method returns false, and setting an 'id' to false is not something Datamapper likes.


Messages In This Thread
changing object in loop in Datamapper ORM to save - by El Forum - 05-11-2011, 12:20 PM
changing object in loop in Datamapper ORM to save - by El Forum - 05-12-2011, 05:43 AM
changing object in loop in Datamapper ORM to save - by El Forum - 05-13-2011, 02:30 AM
changing object in loop in Datamapper ORM to save - by El Forum - 05-13-2011, 02:36 AM
changing object in loop in Datamapper ORM to save - by El Forum - 05-13-2011, 05:00 AM
changing object in loop in Datamapper ORM to save - by El Forum - 05-13-2011, 06:37 AM
changing object in loop in Datamapper ORM to save - by El Forum - 05-13-2011, 08:46 AM
changing object in loop in Datamapper ORM to save - by El Forum - 05-13-2011, 08:57 AM
changing object in loop in Datamapper ORM to save - by El Forum - 05-13-2011, 09:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB