Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/06/2007, 11:17
astut
 
Fecha de Ingreso: septiembre-2005
Ubicación: Valencia
Mensajes: 738
Antigüedad: 18 años, 7 meses
Puntos: 5
Esque solo puedo utilizar un registro 1 vez?

Hola bueno pues la cosa es la siguiente:
Código PHP:
<!--Recoger datos necesarios para configurar las unidades-->
<?php
     $datos_ejercito
mysql_query("select * from ejercito where id= '$_COOKIE[juego_jugador_id]'");
     
$mostrar_ejercitomysql_fetch_array($datos_ejercito);
  
$datos_objetos_escudosmysql_query("select id,nombre from objeto where metodologia= 'equipable' and tipo= 'escudo'");
  
$datos_objetos_yelmosmysql_query("select id,nombre from objeto where metodologia= 'equipable' and tipo= 'yelmo'");
  
$datos_objetos_armadurasmysql_query("select id,nombre from objeto where metodologia= 'equipable' and tipo= 'armadura'");
  
$datos_objetos_armasmysql_query("select id,nombre from objeto where metodologia= 'equipable' and tipo= 'arma'");
?>

<!--Formulario-->
<div class="caja_contenedor">
  <div class="caja_seccion">Administrar unidades</div>
  <div class="caja_contenido">
    <form name="formulario_principal" id="formulario_principal" action="procesar/procesar_ejercito_unidades.php" method="post">
          
            <!--UNIDAD 1-->
            <div style="width: 50%; float: left;">
            <fieldset id="unidad1">
            <legend class="formulario">Unidad 1</legend>
          <!--Nombre-->
          <label for="nombre1" id="label_nombre1" class="formulario">Nombre:</label>
          <input type="text" id="nombre1" name="nombre1" maxlenght="16" tabindex="1"/><br/>
          <!--Escudo-->
          <label for="escudo1" id="label_escudo1" class="formulario">Escudo:</label>
          <select name="escudo1" id="escudo1" tabindex="2">
              <?php
                     
while ($mostrarmysql_fetch_array($datos_objetos_escudos))
              {
                if (
$mostrar["id"]== $mostrar_ejercito["unidad1_escudo"])
                    echo 
"<option value='$mostrar[id]' selected>$mostrar[nombre]</option>";
                  else
                  echo 
"<option value='$mostrar[id]'>$mostrar[nombre]</option>";
              }
            
?>
        </select><br/>
          <!--Yelmo-->
          <label for="yelmo1" class="formulario">Yelmo:</label>
          <select name="yelmo1" id="yelmo1" tabindex="3">
            <?php
              
while ($mostrarmysql_fetch_array($datos_objetos_yelmos))
              {
                if (
$mostrar["id"]== $mostrar_ejercito["unidad1_yelmo"])
                     echo 
"<option value='$mostrar[id]' selected>$mostrar[nombre]</option>";
                  else
                  echo 
"<option value='$mostrar[id]'>$mostrar[nombre]</option>";
              }
            
?>
        </select><br/>
        <!--Armadura-->
          <label for="armadura1" class="formulario">Armadura:</label>
          <select name="armadura1" id="armadura1" tabindex="4">
            <?php
              
while ($mostrarmysql_fetch_array($datos_objetos_armaduras))
              {
                if (
$mostrar["id"]== $mostrar_ejercito["unidad1_armadura"])
                    echo 
"<option value='$mostrar[id]' selected>$mostrar[nombre]</option>";
                        else
                    echo 
"<option value='$mostrar[id]'>$mostrar[nombre]</option>";
              }
            
?>
        </select><br/>
        <!--Arma-->
          <label for="arma1" class="formulario">Arma:</label>
          <select name="arma1" id="arma1" tabindex="5">
            <?php
              
while ($mostrarmysql_fetch_array($datos_objetos_armas))
              {
                if (
$mostrar["id"]== $mostrar_ejercito["unidad1_arma"])
                    echo 
"<option value='$mostrar[id]' selected>$mostrar[nombre]</option>";
                  else
                  echo 
"<option value='$mostrar[id]'>$mostrar[nombre]</option>";
              }
            
?>
        </select>
          </fieldset><br/>
      </div>
        






        <!--UNIDAD 2-->
        <div style="width: 50%; float: right;">
            <fieldset id="unidad2">
            <legend class="formulario">Unidad 2</legend>
          <!--Nombre-->
          <label for="nombre2" id="label_nombre2" class="formulario">Nombre:</label>
          <input type="text" id="nombre2" name="nombre2" maxlenght="16" tabindex="6"/><br/>
          <!--Escudo-->
          <label for="escudo2" id="label_escudo2" class="formulario">Escudo:</label>
          <select name="escudo2" id="escudo2" tabindex="7">
              <?php
                     
while ($mostrarmysql_fetch_array($datos_objetos_escudos))
              {
                if (
$mostrar["id"]== $mostrar_ejercito["unidad2_escudo"])
                    echo 
"<option value='$mostrar[id]' selected>$mostrar[nombre]</option>";
                  else
                  echo 
"<option value='$mostrar[id]'>$mostrar[nombre]</option>";
              }
            
?>
        </select><br/>
          <!--Yelmo-->
          <label for="yelmo2" class="formulario">Yelmo:</label>
          <select name="yelmo2" id="yelmo2" tabindex="8">
            <?php
              
while ($mostrarmysql_fetch_array($datos_objetos_yelmos))
              {
                if (
$mostrar["id"]== $mostrar_ejercito["unidad2_yelmo"])
                     echo 
"<option value='$mostrar[id]' selected>$mostrar[nombre]</option>";
                  else
                  echo 
"<option value='$mostrar[id]'>$mostrar[nombre]</option>";
              }
            
?>
        </select><br/>
        <!--Armadura-->
          <label for="armadura2" class="formulario">Armadura:</label>
          <select name="armadura2" id="armadura2" tabindex="9">
            <?php
              
while ($mostrarmysql_fetch_array($datos_objetos_armaduras))
              {
                if (
$mostrar["id"]== $mostrar_ejercito["unidad2_armadura"])
                    echo 
"<option value='$mostrar[id]' selected>$mostrar[nombre]</option>";
                        else
                    echo 
"<option value='$mostrar[id]'>$mostrar[nombre]</option>";
              }
            
?>
        </select><br/>
        <!--Arma-->
          <label for="arma2" class="formulario">Arma:</label>
          <select name="arma2" id="arma2" tabindex="10">
            <?php
              
while ($mostrarmysql_fetch_array($datos_objetos_armas))
              {
                if (
$mostrar["id"]== $mostrar_ejercito["unidad2_arma"])
                    echo 
"<option value='$mostrar[id]' selected>$mostrar[nombre]</option>";
                  else
                  echo 
"<option value='$mostrar[id]'>$mostrar[nombre]</option>";
              }
            
?>
        </select>
          </fieldset><br/>
      </div>
Si ven los codigos php, solo funcionan en el primer fragmento en el segundo ya no cometen con su cometido... ¿porque? gracias