Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/11/2009, 11:44
Avatar de konoyek
konoyek
 
Fecha de Ingreso: julio-2007
Mensajes: 268
Antigüedad: 16 años, 9 meses
Puntos: 0
problemas ingreso into php

hola a todos en este momento tengo el siguiente codigo

Código PHP:
<?
$dbhost
="localhost";  // host del MySQL (generalmente localhost)
$dbusuario="root"// aqui debes ingresar el nombre de usuario
                      // para acceder a la base
$dbpassword="123456"// password de acceso para el usuario de la
                      // linea anterior
$db="formulario";        // Seleccionamos la base con la cual trabajar

$conexion mysql_connect($dbhost$dbusuario$dbpassword);
mysql_select_db($db$conexion);


if (!isset(
$accion)){
        echo
"
        <html>
        <head><title>Guardar datos en la base</title></head>
        <body>
<h3>Guardar datos en la base</h3>
<form name='form1' method='post'
    action='view.php?accion=guardar'>
  <p>Nombre Completo:<br>
    <input type='text' name='nombre'>
  </p>
  <p>Institucion<br>
    <input type='text' name='institucion'>
  </p>
  <p>Numero Telefonico:<br>
    <input type='text' name='telefono'>
  </p>
  <p>
    <input type='submit' name='Submit' value='Guardar Datos'>
  </p>
</form>
</body>
</html>"
;
}elseif(
$accion=="guardar"){
    
mysql_query("INSERT INTO registro (ID, nombre, institucion, telefono) VALUES ('',$nombre,$institucion,$telefono)");
  echo
" <html>
    <head></head>
    <body>
    <h3>Los datos han sido guardados</h3>
    </body>
    </html>"
;








$result=mysql_query("SELECT * FROM registro",$conexion);
echo
"<table width=100%>
<tr>
<td><b>Codigo de registro</b></td><td><b>Cedula</b></td>

<td><b>Nombre Completo</b></td><td><b>Institucion</b></td><td><b>Telefono</b></td><td><b>Municipio</b></td><td><b>Duracion</b></td><td><b>Calificacion</b></td>
</tr>
"
;
while(
$row=mysql_fetch_row($result)){
  echo
"<tr>
    <td>$row[1]</td><td>$row[2]</td><td>$row[3]</td><td>$row[4]</td><td>$row[5]</td><td>$row[6]</td><td>$row[7]</td><td>$row[8]</td>
    </tr>"
;
}
echo
"</table>";

}
?>
necesito almacenar los datos por medio del into a la columna nombre, institucion, telefono pero no me almacena nada no se en que este fallando o cual sea el error espero me puedan colaborar