Ayuda super urgente con Php, Htm y MySql
Publicado por Vianey (6 intervenciones) el 17/01/2008 19:59:39
HOLA QUE TAL.
Necesito ayuda, no se donde esté el error.
Tengo el apache y el php funcionando, y estoy intentando insertar datos desde php y no puedo.
Creo que no hay error en la conexion, porque puedo hacer la consulta desde Php, insertando datos directamente desde MySql.
El error está en que no puedo insertar datos desde Php, y no se porque. Solo agregó una sola vez y con puros campos en blanco.
Aquí les dejo el codigo de los archivos que manejo. Espero me puedan ayudar.
__________________
ARCHIVO EN HTML
___________________
<html>
<head><title>REGISTRAR NUEVO CLIENTE</title></head>
<body bgcolor = #CCFF33>
<font color = #0099FF size = "+3">
<center>
<form method = "post" name = "procedim" action = "InsertIntoCliente.php">
CLAVE: <input type = "text" name = "Clave"><br>
CONFIRMAR CLAVE: <input type = "text" name = "ConfirmarClave"><br>
NOMBRE: <input type = "text" name = "Nombre"><br>
TELEFONO: <input type = "text" name = "Telefono"><br>
PAIS: <input type = "text" name = "Pais"><br>
ESTADO: <input type = "text" name = "Estado"><br>
CIUDAD: <input type = "text" name = "Ciudad"><br>
DOMICILIO: <input type = "text" name = "Domicilio"><br>
COLONIA: <input type = "text" name = "Colonia"><br>
CODIGO POSTAL: <input type = "text" name = "CodigoPostal"><br>
TARJETA: <input type = "text" name = "Tarjeta"><br>
CUENTA: <input type = "text" name = "Cuenta"><br>
<input type = "reset" name = "bborra" value = "Borrar Datos">
<input type = "submit" name = "boton" value = "Registrar Clientes"><br>
</form>
</center>
</font>
</body>
</html>
_____________________
ARCHIVO EN PHP
_____________________
<html>
<head><title>INSERTAR CLIENTE</title></head>
<body bgcolor = #FF99FF>
<?php
$db=mysql_connect("localhost","root","");
mysql_select_db("carritos",$db);
mysql_query("INSERT into cliente VALUES('$Clave','$ConfirmarClave','$Nombre','$Telefono','$Pais','$Estado','$Ciudad','$Domicilio','$Colonia','$CodigoPostal','$Tarjeta','$Cuenta')", $link) or die (mysql_error());
mysql_close($db);
?>
</body>
</html>
*+*+*+*+*+ *+*+*+*+*+ G r A c I a S d E a N t E m A n O *+*+*+*+*+ *+*+*+*+*+
Necesito ayuda, no se donde esté el error.
Tengo el apache y el php funcionando, y estoy intentando insertar datos desde php y no puedo.
Creo que no hay error en la conexion, porque puedo hacer la consulta desde Php, insertando datos directamente desde MySql.
El error está en que no puedo insertar datos desde Php, y no se porque. Solo agregó una sola vez y con puros campos en blanco.
Aquí les dejo el codigo de los archivos que manejo. Espero me puedan ayudar.
__________________
ARCHIVO EN HTML
___________________
<html>
<head><title>REGISTRAR NUEVO CLIENTE</title></head>
<body bgcolor = #CCFF33>
<font color = #0099FF size = "+3">
<center>
<form method = "post" name = "procedim" action = "InsertIntoCliente.php">
CLAVE: <input type = "text" name = "Clave"><br>
CONFIRMAR CLAVE: <input type = "text" name = "ConfirmarClave"><br>
NOMBRE: <input type = "text" name = "Nombre"><br>
TELEFONO: <input type = "text" name = "Telefono"><br>
PAIS: <input type = "text" name = "Pais"><br>
ESTADO: <input type = "text" name = "Estado"><br>
CIUDAD: <input type = "text" name = "Ciudad"><br>
DOMICILIO: <input type = "text" name = "Domicilio"><br>
COLONIA: <input type = "text" name = "Colonia"><br>
CODIGO POSTAL: <input type = "text" name = "CodigoPostal"><br>
TARJETA: <input type = "text" name = "Tarjeta"><br>
CUENTA: <input type = "text" name = "Cuenta"><br>
<input type = "reset" name = "bborra" value = "Borrar Datos">
<input type = "submit" name = "boton" value = "Registrar Clientes"><br>
</form>
</center>
</font>
</body>
</html>
_____________________
ARCHIVO EN PHP
_____________________
<html>
<head><title>INSERTAR CLIENTE</title></head>
<body bgcolor = #FF99FF>
<?php
$db=mysql_connect("localhost","root","");
mysql_select_db("carritos",$db);
mysql_query("INSERT into cliente VALUES('$Clave','$ConfirmarClave','$Nombre','$Telefono','$Pais','$Estado','$Ciudad','$Domicilio','$Colonia','$CodigoPostal','$Tarjeta','$Cuenta')", $link) or die (mysql_error());
mysql_close($db);
?>
</body>
</html>
*+*+*+*+*+ *+*+*+*+*+ G r A c I a S d E a N t E m A n O *+*+*+*+*+ *+*+*+*+*+
Valora esta pregunta


0