Ver Mensaje Individual
  #3 (permalink)  
Antiguo 27/06/2011, 15:58
bon3
 
Fecha de Ingreso: mayo-2011
Mensajes: 55
Antigüedad: 13 años
Puntos: 1
Respuesta: Problema con un select

Cita:
Iniciado por AlvaroX Ver Mensaje
puedes mostrar el codigo ? formulario y proceso?
Claro que si mira estos son los select que tengo donde dice campos se muestran todos los campos de mi base de datos y es donde selecciona los campos el usuario para pasarlos al otro select multiple y tamb se agregan automaticamente al select simple es en donde tengo ese problema

Código PHP:
<html>
<body>
<div class="h1s" style="float: left;"  align="right">
  <label>Campos</label>
         <br>
<?php
          
//Te conectas a tu base de datos Ej:

$linkmysql_connect("localhost","root","");

//Realizas tu consulta SQL Ej:

$result=mysql_query("SELECT COLUMN_NAME FROM information_schema.`COLUMNS` WHERE TABLE_SCHEMA = 'bd' AND TABLE_NAME = 'julio'" ,$link);

//Llenas el combo

if ($row mysql_fetch_array($result)){ 
echo 
'<select id="sel1" size="10" style="width:150;" multiple>';
do {
       echo 
'<option value= "'.$row["COLUMN_NAME"].'">'.$row["COLUMN_NAME"].'</option>';
} while (
$row mysql_fetch_array($result)); 
echo 
'</select>';

}
          
?>
</div>
    <div style="float: left; padding-top: 20px;" align="center">
         <input name="button" type="button" onClick="insertar()" value="Incluir >">
        <br>
         <input name="button" type="button" onClick="vaciar()" value="<< Vaciar">
</div>
      <div style="float: left;" align="center">
      <label>Campos Seleccionados<br>
        <span style="float: left;">
            <select name="sel2[]" size="10" multiple id="sel2[]" style="width:150;">
          </select>
        </span>
      </label>
          <input type="hidden" name="subcategoria" value="">
          <input type="hidden" name="of_area" value="">    
    </div>
    </br>

    <label for="cmbx2">
  <div align="center">&nbsp; <span class="negritas">Condicion Entre Campos</span></div>
<label for="cmbx2"></label>
    <div align="center">
<label for="cmbx"></label>
          <select name="sel3" id="sel3" style='width:180px;'>
          </select>
<label for="cmbx3"></label>
      <select name="cmbx3" id="cmbx3" style='width:85px;'>
        <option value="1" selected="selected">Igual</option>
<option value="2">Menor</option>
<option value="3">Mayor</option>
        <option value="4">Diferente</option>
      </select>
<label for="txt"></label>
          <input type="text" name="txt1" id="txt1" />
      </div>

</body>
</html>