
15/06/2004, 08:45
|
| | Fecha de Ingreso: junio-2004
Mensajes: 5
Antigüedad: 20 años, 9 meses Puntos: 0 | |
Ha la primera pregunta la funcion mysql_fetch_array() devuelve un array asociativo cuyo indices son los nombre de los campo de la tabla ej:
salida['nombre_campo'];
Para usar como indices numeros prueba con la funcion mysql_fetch_row()
----------------------------------------------------------------
Para la segunda duda prueba con esto. <html> <?php include (conex.phtml); $busqueda=conectarse(); $DNI=$_GET['DNI']; $busqueda="SELECT * FROM clientes WHERE DNI ='$DNI'"; $resultado_b=mysql_query($busqueda);
if($row=mysql_fetch_row($resultado_b)) :?> /*fijate en los dos puntos y cierre el php*/
<form name=formulario method=post //action=modifica_registro.php//>
<input type=hidden name='DNI' value='$DNI'>
<table border='0' width='769' cellpadding='0' cellspacing='1' >
<input type='HIDDEN' name='id' value='$row[2]' size='10' maxlength='10'>
<tr>
<td width='92' bgcolor='#CCCCCC' height='21'><b>Socios</b></td>
<td width='568' height='21'></td>
</tr>
<tr>
<td width='92' height='28'> Nombre </td>
<td width='568' height='28'> <input type=text name='nombre'value='$row[0]' size='75' maxlength='25' ></td>
</tr>
<tr>
<td width='92' height='34'> Apellidos </td>
<td width='568' height='34'> <input type=text name='apellidos' value='$row[8]' size='75' maxlength='50'></td>
</tr>
<td width='92' height='34'> Telefono </td>
<td width='568' height='34'> <input type=text name='telefon' value='$row[1]' size='75' maxlength='50'></td>
</tr>
<tr>
<td width='92' height='34'> fecha de inscripcion </td>
<td width='568' height='34'> <input type=text name='fecha' value='$row[3]' size='6' maxlength='25'></td>
</tr>
<tr>
<td width='92' height='34'> :Direccion: </td>
<td width='568' height='34'> <input type=text name='direccion' size='5' maxlength='11' value='$row[4]'></td>
</tr>
<tr>
<td width='568' height='2'> email </td>
<input type=text name='email' size='23' maxlength='35' value='$row[5]'>
<td width='92' height='2'> curso:</td>
<input type=text name='curso' size='5' maxlength='11' value='$row[6]'>
<td width='92' height='2'> edad:</td>
<input type=text name='curso' size='5' maxlength='11' value='$row[7]'>
<INPUT TYPE='submit' NAME='accion' VALUE='Devolucion libro'>
</td>
</tr>
</table>
</form> <? endif ;?> //cierra el if de esta forma
</html> |