Hi,
I created mysql table with one index column, with AUTO_INCREMENT
feature. (and the other columns too: Nombre, Apellidos, email,
Direccion, Ciudad, Pais)
In my code, I have:
// Take dat from HTML form
$Nombre = $_POST["Nombre"];
$Apellidos = $_POST["Apellidos"];
$email = $_POST["e-mail"];
$Direccion = $_POST["Direccion"];
$Ciudad = $_POST["Ciudad"];
$Pais = $_POST["Pais"];
$Categoria = $_POST["ProductServOpcion"];
// MySQL server connection
$link = mysql_connect ("servidor", "usuario",
"password") or die ("No pudo conectarse a servidor
MySQL.");
// Database selection
mysql_select_db("baseDatos") or die("No pudo
seleccionarse la base de datos.");
// Query to insert data into table
$insertionQuery = "INSERT INTO Usuarios (Nombre,
Apellidos, email, Direccion, Ciudad, Pais) VALUES
('$Nombre','$Apellidos','$email','$Direccion','$Ci udad','$Pais')";
// Query execution
$insertionResult = mysql_query($insertionQuery) or
die("La consulta de inserción falló");
The message I get is precisely: "La consulta de inserción falló"
(Insertion query failed, in english). And the php script dies.
The strange part is that the first time I ran the html form and php
script, everything was OK. But no more than the first time.
What can be wrong?
All of your help is needed.
Regards,
JaaC