Re: multiple selects into mysql database

From: Date: Thu, 24 Aug 2000 19:24:28 +0000
Subject: Re: multiple selects into mysql database
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-13505@lists.php.net to get a copy of this message
Joao, That was it! I did remove the braces earlier, but evidently, not the correct ones. thanks for all your help and patience. Dan On Thu, 24 Aug 2000, Joao Prado Maia wrote: > At 02:58 PM 8/24/2000 -0400, dbarber wrote: > >Joao, > > > >The contents of the include are inthe original email if you still have > >it. If not, I'll send again. > > > >$discipline does equal Array when in the insert statement, but so does > >$discipline[$z] !! It does not look like $z is incrementing correctly ? > > > >Dan > > Hi Dan, > > Sorry I found the include file as you mentioned. Well, here is the problem : > > <? > $disciplineOption = array("C/C++", "CORBA"); > // do work > for($i=0; $i < count($disciplineOption); $i++) > { > print("<option value=\"$disciplineOption\" "); > print(">{$disciplineOption[$i]}\n"); > } > ?> > > I guess your include file looks like this, after I asked you to change the > weird extra braces. Anyway, the problem is that the value of each <option> > tag is "Array", since you are not passing any subscripts to the array > variable. Try this code : > > <? > $disciplineOption = array("C/C++", "CORBA"); > // do work > for($i=0; $i < count($disciplineOption); $i++) > echo "<option > value='$disciplineOption[$i]'>{$disciplineOption[$i]}</option>\n"; > ?> > > That should work, and do the same as you wanted to do with your two liner > for loop :) > > Regards, > Joao > > -- > Joao Prado Maia > Web Developer > Kefta.com, Inc > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > >

« previous php.general (#13505) next »