Ver Mensaje Individual
  #3 (permalink)  
Antiguo 10/07/2007, 11:02
spork
 
Fecha de Ingreso: julio-2007
Mensajes: 7
Antigüedad: 16 años, 9 meses
Puntos: 0
Re: Introducir registro en una base

Muchas gracias cala932, pero me sigue sin introducir los datos
El archivo del formulario lo he dejado así:
Código:
<html> 
<head> 
   <title>Ejemplo de PHP</title> 
</head> 
<body> 
<H1>Ejemplo de uso de bases de datos con PHP y MySQL</H1> 
<FORM ACTION="procesar.phtml" METHOD="GET"> 
Introduzca su nombre:<INPUT TYPE="text" NAME="nombre"><BR> 
Introduzca sus apellidos:<INPUT TYPE="text" NAME="apellidos"><BR> 
<INPUT TYPE="submit" VALUE="Enviar"> 
</FORM>

<?php 
   include("conex.phtml"); 
   $link=Conectarse(); 
   $result=mysql_query("select * from prueba",$link); 
?> 

<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=1> 
      <TR><TD>&nbsp;<B>Nombre</B></TD> <TD>&nbsp;<B>Apellidos</B>&nbsp;</TD></TR> 
<?php       

   while($row = mysql_fetch_array($result)) { 
      printf("<tr><td>&nbsp;%s</td> <td>&nbsp;%s&nbsp;</td></tr>", $row["nombre"], $row["apellidos"]); 
   } 
   mysql_free_result($result); 
   mysql_close($link);    
?> 
</table> 
</body> 
</html>
¿Podría estar el problema en la tabla?