[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.