Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/11/2004, 16:32
Christo
 
Fecha de Ingreso: noviembre-2004
Mensajes: 1
Antigüedad: 19 años, 5 meses
Puntos: 0
Exclamación Problema en insertar registros mediante PHP y MSSQL

Saludos!!!

Estoy haciendo consultas en php y MSSQL SERVER 2000, en ello no tengo ningun problema ya que lo hace bien,
mi problemas esta que tengo un formulario que pasa mediante el metodo post los valores a agregar a la Base de Datos,
la cosa esta en que no me guarda los datos al server.

Este es el código del Form
-----------------------------------------------------------------------
<form action="add.php" method="post">
<table width="300" border="0" cellpadding="0">
<tr>
<td>Nombre</td>
<td><input type="Text" name="Nombre"></td>
</tr>
<tr>
<td>A. Paterno</td>
<td><input type="Text" name="APat"></td>
</tr>
<tr>
<td>A. Materno</td>
<td><input type="Text" name="AMat"></td>
</tr>
<tr>
<td>Usuario</td>
<td><input type="Text" name="Usuario"></td>
</tr>
<tr>
<td>Clave</td>
<td><input type="Text" name="Clave"></td>
</tr>
<tr>
<td align="right"><input type="Reset" value="Borrar "></td>
<td align="left"><input type="Submit" name="enviar" value="Guardar"></td>
</tr>
</table>
</form>

Y este es el código del archivo php que recibe el valor de los input y lo recibe en la consulta.
-----------------------------------------------------------------------
<?php
include("lib.php");
$Cnx=CnxMSSQL();
# AÑADIR EL NUEVO REGISTRO

$sql = "INSERT INTO $tabla (Nombre, APaterno, AMaterno, Usuario, Clave)
VALUES ('$Nombre', '$APat','$AMat','$Usuario','$Clave')";
mssql_query($sql,$Cnx);

echo "Sus datos han sido agregados.\n";
mssql_close($Cnx);
?>

Podrian ayudarme por favor.
Edgar Rios
Gracias