[eluser]tdktank59[/eluser]
Might have found a bug...
So I can save the new DQIP however it does not save the brainstorm relation to the dqip which is a MANY to MANY relation. (Yes its defined in the models)
Any ideas? All the values are getting passed right just can't seem to get the relation to save. (Also the tables do exist checked that a few times...)
Code Not throwing error when there is an error somewhere...
Code:
// See if this was promoted
if ($this->input->post('brainstorm_id'))
{
// It was a brainstorm being promoted so lets relate the brainstorm to the new dqip
$b = new Brainstorm();
$b->where('id',$this->input->post('brainstorm_id'))->get();
if (!$d->save($b->all))
echo 'Error: '.$b->error->string;
}
Full Source
Code:
$d = New Dqip();
// If we are editing the form
if ($this->input->post('id'))
$d->where('id',$this->input->post('id'))->get();
// Required Fields
// Setting values here...
if (!$d->save())
{
// Spit out an error and
// Load the right page
}
else
{
/** NOT WORKING HERE **/
// See if this was promoted
if ($this->input->post('brainstorm_id'))
{
// It was a brainstorm being promoted so lets relate the brainstorm to the new dqip
$b = new Brainstorm();
$b->where('id',$this->input->post('brainstorm_id'))->get();
if (!$d->save($b))
echo 'Error: '.$d->error->string;
}
/** END NOT WORKING HERE **/
// Spit out the right message
}