MySQL Forums
Forum List  »  Spanish

INSERT crea registros de mas en mi tabla
Posted by: Axl Nolasco
Date: April 28, 2016 03:31PM

HOla!
Tengo un problema con un insert a MYSQL...
Trabaja bien pero cada vez que se ejecuta crea dos tuplas vacias en mi tabla

aqui el codigo

include 'conexion.php';
$nom = $_POST['nom'];
$aP = $_POST['aP'];
$aM = $_POST['aM'];
$mail = $_POST['mail'];
$ins = $_POST['ins'];
$cd = $_POST['cd'];
$ed = $_POST['ed'];
$tel = $_POST['tel'];
$edad = $_POST['eda'];
$dir = $_POST['dir'];
$ocu = $_POST['ocu'];
$fecha = $_POST['fecha'];
$cantidad = $_POST['cantidad'];
$xochi = $_POST['xochi'];


$query= "INSERT INTO `datos`(`nombre`, `paterno`, `materno`, `edad`,
`estado`, `ciudad`, `instituto`, `telefono`, `mail`, `domicilio`,
`ocupacion`, `fecha`, `cantidad`, `xochi`)
VALUES ('".$nom."' , '".$aP."' , '".$aM."' , '".$edad."' , '".$ed."' ,
'".$cd."' , '".$ins."' , '".$tel."' , '".$mail."', '".$dir."', '".$ocu."',
'".$fecha."', '".$cantidad."', '".$xochi."')";
mysql_query($query,$conexion);



if (mysqli_query($conexion, $query)) {
echo "New record created successfully";
} else {
echo "Error: " . $query . "<br>" . mysqli_error($conexion);
}

mysqli_close($conexion);

Options: ReplyQuote


Subject
Views
Written By
Posted
INSERT crea registros de mas en mi tabla
1172
April 28, 2016 03:31PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.