On May 30, 11:11*pm, Geoff Cox <g...@freeuk.com> wrote:
> On Sat, 30 May 2009 05:22:03 -0700 (PDT), JR
>
> <groups_j...@yahoo.com.br> wrote:
> >Hi,
> >If I'm not mistaken, you need to create an object (params), don't you?
> >And supposing c2 and correct_answerc2 are arrays created somewhere in
> >your code before loop, then:
>
> >var params = {}, i = 0;
> >while (i < 2) {
> > *++i;
> > *params["mysql_c2" + i + "answer"] = "c2[" + i +"]";
> > *params["mysql_c2" + i + "correctanswer"] = "correct_answerc2["+ i
> >+"]";
> >}
>
> >Joao Rodrigues
>
> Many thanks Joao - just the ticket!
Incidentally, square bracket notation is covered in the FAQ and notes:
<url:
http://www.jibbering.com/faq/#propertyAccessAgain >
--
Rob