hola a todos, espero qu eme puedan ayudar con el siguiente codigo lo que pasa es que nesecito hacer una relacion de dos listas/menu.
 
tengo una base de datos que se llama villa y una tabla que se llama pruevavilla
con varios campos, nocc, nombredelconcepto, ncg, nombredelconceptodecarga,  y egreingre.
 
 
lo que ya hise es llamar con funcion select los datos de cada uno de ellos en una lista o menu desplegable y lo que nesecito es que cuando yo elija la opcion de ncc algun numero en nombre de concepto me carge el correspondiente ejemplo:
 
NoCC             NOMBRE_DEL_CONCEPTO
  10                      CAJEROSLUNARIS
 
 
EN DODE NOCC Y NOMBRE DEL CONCEPTO SON LISTAS DESPLEGABLES QUE ESTAN JALANDODATOS DE  MYSQL.
 
AQUI EL CODIGO QUE TENGO ASTA EL MOMENTO ESPERO ME PUEDAN AYUDAR.
 
 
<?php require_once('Connections/hugoss.php'); ?>
<?php
mysql_select_db($database_hugoss, $hugoss);
$query_Recordset1 = "SELECT pruevahugos.NOMBRE_DEL_CONCEPTO FROM pruevahugos";
$Recordset1 = mysql_query($query_Recordset1, $hugoss) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
 
mysql_select_db($database_hugoss, $hugoss);
$query_Recordset2 = "SELECT pruevahugos.NoCC FROM pruevahugos";
$Recordset2 = mysql_query($query_Recordset2, $hugoss) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
 
mysql_select_db($database_hugoss, $hugoss);
$query_Recordset3 = "SELECT pruevahugos.NoCG FROM pruevahugos";
$Recordset3 = mysql_query($query_Recordset3, $hugoss) or die(mysql_error());
$row_Recordset3 = mysql_fetch_assoc($Recordset3);
$totalRows_Recordset3 = mysql_num_rows($Recordset3);
 
mysql_select_db($database_hugoss, $hugoss);
$query_Recordset4 = "SELECT pruevahugos.NoC FROM pruevahugos";
$Recordset4 = mysql_query($query_Recordset4, $hugoss) or die(mysql_error());
$row_Recordset4 = mysql_fetch_assoc($Recordset4);
$totalRows_Recordset4 = mysql_num_rows($Recordset4);
 
mysql_select_db($database_hugoss, $hugoss);
$query_Recordset5 = "SELECT pruevahugos.NOMBRE_DEL_CONCEPTO_DE_GASTOS FROM pruevahugos";
$Recordset5 = mysql_query($query_Recordset5, $hugoss) or die(mysql_error());
$row_Recordset5 = mysql_fetch_assoc($Recordset5);
$totalRows_Recordset5 = mysql_num_rows($Recordset5);
 
mysql_select_db($database_hugoss, $hugoss);
$query_Recordset6 = "SELECT pruevahugos.ING_EGR FROM pruevahugos";
$Recordset6 = mysql_query($query_Recordset6, $hugoss) or die(mysql_error());
$row_Recordset6 = mysql_fetch_assoc($Recordset6);
$totalRows_Recordset6 = mysql_num_rows($Recordset6);
 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
<!--
.Estilo1 {
	font-size: xx-large;
	font-weight: bold;
}
-->
</style>
</head>
<body>
<div align="center">
  <h3 class="Estilo1">PRUEBA DE BOTONES SELECT </h3>
  <p class="Estilo1">
    <select name="select2">
      <?php
do {  
?>
      <option value="<?php echo $row_Recordset2['NoCC']?>"><?php echo $row_Recordset2['NoCC']?></option>
      <?php
} while ($row_Recordset2 = mysql_fetch_assoc($Recordset2));
  $rows = mysql_num_rows($Recordset2);
  if($rows > 0) {
      mysql_data_seek($Recordset2, 0);
	  $row_Recordset2 = mysql_fetch_assoc($Recordset2);
  }
?>
    </select>
  </p>
  <p class="Estilo1">
    <select name="select">
      <?php
do {  
?>
      <option value="<?php echo $row_Recordset1['NOMBRE_DEL_CONCEPTO']?>"><?php echo $row_Recordset1['NOMBRE_DEL_CONCEPTO']?></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>
  </p>
  <form name="form3" id="form3" method="post" action="">
    <select name="select3">
      <?php
do {  
?>
      <option value="<?php echo $row_Recordset3['NoCG']?>"><?php echo $row_Recordset3['NoCG']?></option>
      <?php
} while ($row_Recordset3 = mysql_fetch_assoc($Recordset3));
  $rows = mysql_num_rows($Recordset3);
  if($rows > 0) {
      mysql_data_seek($Recordset3, 0);
	  $row_Recordset3 = mysql_fetch_assoc($Recordset3);
  }
?>
    </select>
  </form>
  <form name="form4" id="form4" method="post" action="">
    <select name="select4">
      <?php
do {  
?>
      <option value="<?php echo $row_Recordset4['NoC']?>"><?php echo $row_Recordset4['NoC']?></option>
      <?php
} while ($row_Recordset4 = mysql_fetch_assoc($Recordset4));
  $rows = mysql_num_rows($Recordset4);
  if($rows > 0) {
      mysql_data_seek($Recordset4, 0);
	  $row_Recordset4 = mysql_fetch_assoc($Recordset4);
  }
?>
    </select>
  </form>
  <form name="form5" id="form5" method="post" action="">
    <select name="select5">
      <?php
do {  
?>
      <option value="<?php echo $row_Recordset5['NOMBRE_DEL_CONCEPTO_DE_GASTOS']?>"><?php echo $row_Recordset5['NOMBRE_DEL_CONCEPTO_DE_GASTOS']?></option>
      <?php
} while ($row_Recordset5 = mysql_fetch_assoc($Recordset5));
  $rows = mysql_num_rows($Recordset5);
  if($rows > 0) {
      mysql_data_seek($Recordset5, 0);
	  $row_Recordset5 = mysql_fetch_assoc($Recordset5);
  }
?>
    </select>
  </form>
  <form name="form6" id="form6" method="post" action="">
    <select name="select6">
      <?php
do {  
?>
      <option value="<?php echo $row_Recordset6['ING_EGR']?>"><?php echo $row_Recordset6['ING_EGR']?></option>
      <?php
} while ($row_Recordset6 = mysql_fetch_assoc($Recordset6));
  $rows = mysql_num_rows($Recordset6);
  if($rows > 0) {
      mysql_data_seek($Recordset6, 0);
	  $row_Recordset6 = mysql_fetch_assoc($Recordset6);
  }
?>
    </select>
  </form>
  <p class="Estilo1">  </p>
</div>
</body>
</html>
<?php
mysql_free_result($Recordset1);
 
mysql_free_result($Recordset2);
 
mysql_free_result($Recordset3);
 
mysql_free_result($Recordset4);
 
mysql_free_result($Recordset5);
 
mysql_free_result($Recordset6);
 
 
?> 
  
 
 
Este tema le ha gustado a 1 personas