Re: Making Forms using Loops for Populating Multiple Database Entries

2010-11-14 Thread Rameez
Hey I was looking around in the cake folder and opened to model class to look at how save was working, found this lying in the create() function there $this->id = false; seems to have done the trick, it. Thanks for your help, I am trying to resolve the saveall() issue now, still can get that to w

Re: Making Forms using Loops for Populating Multiple Database Entries

2010-11-14 Thread Rameez
No I haven't used Bake as yet, but the structure is really simple. I ll skip the answers part because that is not relevant here Survey Model ---ID (primary key) ---Name Question Model ---ID (primary key) ---Text ---Survey ID (foreign key) so what happens is I am looking at all the surveys I have

Re: Making Forms using Loops for Populating Multiple Database Entries

2010-11-13 Thread Pablo Terradillos
Also, have you tried to generate code with bake? it could be helpful or you could see what are you doing wrong at least http://book.cakephp.org/view/1522/Code-Generation-with-Bake Pablo E. Terradillos On Sun, Nov 14, 2010 at 12:43 AM, Pablo Terradillos wrote: > I'm not sure if i understand co

Re: Making Forms using Loops for Populating Multiple Database Entries

2010-11-13 Thread Pablo Terradillos
I'm not sure if i understand correctly your first issue... Have your associated model the corresponding foreign key and, also, a primary key? For example, Questions id text Answers id question_id text Regarding the second issue, remember to enclose modelName.$i.field with double quotes so $i

Re: Making Forms using Loops for Populating Multiple Database Entries

2010-11-13 Thread Rameez
Thank you for your response, I in fact did do what you said about the first problem and resolved that error. I was passing the parameter to a page that has a form. The create function in the view, would recall the same action using the $options as 'action'. I added the 'url tag to the' $options arr

Re: Making Forms using Loops for Populating Multiple Database Entries

2010-11-13 Thread Pablo Terradillos
Have your model the corresponding associations? Questions have many answers? if so, you could check what your form is POSTing using debug($this->data); in order to check if you are making all in a the correct way You may not have any problems putting the form generator in a loop, as long as your

Making Forms using Loops for Populating Multiple Database Entries

2010-11-13 Thread Rameez
I am new to cake php so please bear with me. I am trying to create a survey for which i can create multiple choice questions. i am running into two issues 1) for multiple choice questions i have a form that takes all the answer choices and saves them as separate entries inside the answers database