Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/07/2012, 14:37
chezsa25
 
Fecha de Ingreso: abril-2012
Mensajes: 58
Antigüedad: 12 años, 1 mes
Puntos: 0
lista menu mysql php

hola queridos foristas necesito insertar una lista menu multiple pero no e logrado hacerlo.... me consegui el siguiente codigo pero no veo en donde se selecciona la base de datos el usuario y password ni nada.. por favor me podrian colaborar Muchisimas graciass

<?
// if there is post data process it
if(!empty($_POST['mySelect']))
{
// extract the array of list choices from the post data
$mySelect = $_POST['mySelect'];

$numChoices = count($mySelect);
$insertVal = "";

for($i = 0; $i < $numChoices; $i++)
{
// concatenate each array value to one string variable
$insertVal .= $mySelect[$i];

// put a comma after all but the last value
if($i != $numChoices - 1)
{
$insertVal .= ",";
}
}
echo $insertVal;
}
// otherwise show the form
else
{
?>
<form action="<? $PHP_SELF ?>" method="post">
<select name="mySelect[]" multiple="multiple">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
<br /><br />
<input type="submit" />
</form>
<?}?>