[SOLVED] Using controller to define db input

Same here! No nothing was echoed so I just keep getting more confused. I am rebuilding test files now. Like I said I created CRUD with giix but I will create the test files with gii and see if I can recreate the problem and then post that.

Well… if you don’t get any echo that means only one thing… that the script does not continue execution after the call to save()… so maybe it breaks during the save…

I would suggest you to set PHP to display all the errors with the E_STRICT settings - http://php.net/manual/en/migrating5.errorrep.php

Ok here are some test files and MySQL db scheme that replicates the problem I am having.

Inside the zip there are two folders labeled working / notworking. Working is using CActiveForm to input the data. Notworking is using the controller to try and input the same data.

Ok I am familiar with E_STRICT (obviously didn’t cross my mind in t/s this) so I will apply it and see what I get. Thanks for another tip.

Hmmm

In the code you gave in test.zip… you have a big problem… and I’m not sure that you used similar code before… as all the test I was suggesting would give no result…

Here the problem is that you have this check


if(isset($_POST['TestParty'], $_POST['TestMember']))

But the form is posting only the TestMember… there are no TestParty data… so the complete IF is skipped… and then there would be no echo that you got on your comment #5

Are you saying that I should use a different variable here


$model = new TestParty;

therefore I don’t have to use $model in


<?php echo $form->errorSummary(array($model, $member)); ?>

???

I’m saying that the result of the IF is false… so nothing is executed inside that IF…

Dang all that time and headaches because I am focusing on the wrong section of code. mdomba thank you so much for sticking with me on this. Amazing how things work when all parts of the code are written correctly!

I think mdomba is a Yii hero!!!