Re: \|/ html multiple select array and mysql

From: Date: Tue, 06 Nov 2001 17:12:13 +0000
Subject: Re: \|/ html multiple select array and mysql
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-73618@lists.php.net to get a copy of this message
This is because since $planes is an array, you can't simply reference it as $planes to have all of its values go into your database table. When you try to reference arrays or objects simply by their name, this is how PHP returns to you the fact that this is of type "array" or "object." This is so you can change your code accordingly. How exactly were you planning on representing the data from the $planes array in your database? Sam Masiello Software Quality Assurance Engineer Synacor (716) 853-1362 X289 smasiello@synacor.com ----- Original Message ----- From: "Gerry Figueroa Anadon" <gerry@dynamicintermedia.com> To: <php-general@lists.php.net> Sent: Tuesday, November 06, 2001 1:26 PM Subject: [PHP] \|/ html multiple select array and mysql > Hello: > > I need to find out why my multiple[] array is loading the word "Array" into MySQl table instead of > the array values. > > I've search all the lists and all I've learned is to put the [] to make my select an array. > > this is the html: > <select name="planes[]" multiple> > <option value="La_Reforma">La Reforma > <option value="Cruz_Azul">Cruz Azalea > <option value="Triple_SSS">Triple SSS > </select> > > and here is my sql: > > $result = mysql_query("insert into doctors values(\"\", \"$nombre\", \"$apellido1\", \"$apellido2\", > \"$especialidad\", \"$planes\", \"$direccion_postal\", > \"$direccion2\", \"$pueblo\", \"$zip_code\", > \"$telefono\", \"$fax\", \"$website\", \"$email\", > \"$idiomas\", \"$intereses\", \"$comentarios\")") > or die ("could not execute"); > > Before I learned to make the name an array I would just get the last or first value. > > I would gratelly appreciate a push in the right direction!!! > > > Many Thanks: > -- > Gerry Figueroa > Dynamic Intermedia > > -- > 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 (#73618) next »