Wow, that was a long post ... not many people will stck around to read
all of that :o)

>From what I have read it appears you are trying to save multiple
OfferedSubject at once, each having their own HABTM Course.

For starters, you simply can't use one save call to do this.  You can
use saveAll() to save one OfferedSubject along with it's HABTM data,
but not many OfferedSubject and their individual HABTM data.

If you want to stick with the same view then you would have to loop
through the build the data array so you could then loop through it in
the controller saving each OfferedSubject along with it's HABTM Course
data.

the data array would have to be

Array
(
    [0] => Array
        (
            [OfferedSubject] => Array
                (
                    [section] =>
                    [days] =>
                    [times] =>
                    [room] =>
                    [limits] =>
                    [gender_flag] =>
                    [college_id] => 1
                    [college_id] => 1
                )

            [Course] => Array
                (
                    [Course] => Array
                    (
                        [3] => 1
                        [7] => 1
                        [12] => 1
                    )
                )
        )

    [1] => Array
        (
            [OfferedSubject] => Array
                (
                    [section] =>
                    [days] =>
                    [times] =>
                    [room] =>
                    [limits] =>
                    [gender_flag] =>
                    [college_id] => 1
                    [college_id] => 1
                )

            [Course] => Array
                (
                    [Course] => Array
                    (
                        [5] => 1
                    )
                )
        )

    [2] => Array
        (
            [OfferedSubject] => Array
                (
                    [section] =>
                    [days] =>
                    [times] =>
                    [room] =>
                    [limits] =>
                    [gender_flag] =>
                    [college_id] => 1
                    [college_id] => 1
                )

            [Course] => Array
                (
                    [Course] => Array
                    (
                        [2] => 1
                        [9] => 1
                    )
                )
        )
)

The way you have it, each time you echo your Course input field it is
overwriting the previous Course input as they've all got the same id
and name.

Hope this helps.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to