Retroceder   Foros del Web > Programación para sitios web > PHP

Respuesta
 
Herramientas Desplegado
Antiguo 30-may-2008, 11:09   #1 (permalink)
congas1983 ha deshabilitado el karma
 
Fecha de Ingreso: septiembre-2007
Mensajes: 25
combox

Bueos dias

amigos

tengo un problema combox anidados
tengo una tabla en mysql llamada integrante en la cual tengo una serie de datos organizados de cuerdo al numero de cedula

yo genere este un codigo
para que cuando se cargue una pagina de consulta y me aparezcan todas las cedulas de labla en un un primer combo o lista menu, hasta va todo bien.
yo tengo un segundo combo
este combo quiero que se mantenga inactivo, hasta que alguien seleccione un numero de cedula y que este combo me muestre nombre de la persona que aquien pertenece el numero de cedula seleccionado.

este es codigo

<?php require_once('Connections/prueba.php'); ?>
<?php require_once('Connections/cedula.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

mysql_select_db("sisbagir");
$query_Recordset1 = "SELECT integrante.cedula FROM integrante";
$Recordset1 = mysql_query($query_Recordset1, $cedula) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<html>
<head>
<title>Documento sin título</title>
</head>

<body>
<form id="form1" name="form1" method="post" action="">
<label>
<select name="select" id="select">
<?php
do {
?>
<option value="<?php echo $row_Recordset1['cedula']?>"><?php echo $row_Recordset1['cedula']?></option>
<?php
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
$rows = mysql_num_rows($Recordset1);
if($rows > 0) {
mysql_data_seek($Recordset1, 0);
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
}
?>
</select>
</label>
<label><?
$select=$_REQUEST['select.value'];
$query_Recordset1 = "SELECT integrante.nombres FROM integrante where cedula='$select'";
$Recordset1 = mysql_query($query_Recordset1, $prueba) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);?>

<select name="select2" id="select2">
<?php
do {
?>
<option value="<?php echo $row_prueba['nombres']?>"<?php if (!(strcmp($row_prueba['nombres'], $row_Recordset1['nombres']))) {echo "selected="selected"";} ?>><?php echo $row_prueba['nombres']?></option>
<?php
} while ($row_prueba = mysql_fetch_assoc($prueba));
$rows = mysql_num_rows($prueba);
if($rows > 0) {
mysql_data_seek($prueba, 0);
$row_prueba = mysql_fetch_assoc($prueba);
}
?>
</select>
</label>
</form>
</body>
</html>
<?php
mysql_free_result($Recordset1);

?>
congas1983 está desconectado   Responder Citando
Antiguo 30-may-2008, 12:03   #2 (permalink)
$this->role('moderador');
GatorV es realmente agradableGatorV es realmente agradableGatorV es realmente agradableGatorV es realmente agradableGatorV es realmente agradableGatorV es realmente agradable
 
Avatar de GatorV
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ags/
Mensajes: 16.011
Respuesta: combox

Tema trasladado a PHP General.
__________________
Blog Web
GatorV está desconectado   Responder Citando
Respuesta

No hay votos aún.


Herramientas
Desplegado

Normas de Publicación
No puedes crear nuevos temas
No puedes responder temas
No puedes subir archivos adjuntos
No puedes editar tus mensajes

BB code is Activado
Caritas están Activado
[IMG] está Activado
Código HTML está Desactivado


La Zona horaria es GMT -6. Ahora son las 10:30.


Message Board Statistics

LinkBacks Enabled by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96