Ver Mensaje Individual
  #5 (permalink)  
Antiguo 04/12/2005, 10:27
Caroline_
 
Fecha de Ingreso: diciembre-2005
Mensajes: 15
Antigüedad: 18 años, 4 meses
Puntos: 1
Hola Seppo:

Sale un error en la parte de verificar la condición si es que existe un registro; es decir, aqui:
---> if (mysql_num_rows($q_id) == 1)

el error dice lo siguiente:
---> Warning: Supplied argument is not a valid MySQL result resource

además no pasa nada cuando selecciono una opción de mi lista de selección.

Todo el código es este:

<form name="form" method="get" action="mod_reg.php">
<?php
$conexion = mysql_connect("localhost", "");
mysql_select_db("dbSeduca",$conexion);
$ids = mysql_query("Select * from estudiante",$conexion);
$q_id = mysql_query("select * from estudiante where id='$cod'",$conexion);
?>

Seleccione id:
<select name="code" type="text" onchange="document.href='vertextos.php?cod=' + this.value">
<?php
while ($reg = mysql_fetch_row($ids))
{
echo "<option value=".$reg[0]. ">".$reg[0]."</option>";
}
?>
</select>
<?php
if (mysql_num_rows($q_id) == 1)
{
$datos = mysql_fetch_row($sql);
echo "Dato0: ".$datos[0]."<br />";
echo "Dato1: ".$datos[1]."<br />";
echo "Dato2: ".$datos[2]."<br />";
}
?>
<br>

Nombre: <input type="text" name="nom"> <br>
Direccion: <input type="text" name="dir"> <br>
Carnet: <input type="text" name="ci"> <br>
<input type="submit" value="Modificar">
</form>

Otra duda, para visualizar los datos en las cajas de texto, el último código php tendría que ponerlo en los input?

Por favor revisamelo y responde mi duda, ok?

Muchas gracias