I'm Inserting data using method post to MySql database, but I don't want to insert duplicated data in this database.
I used this:
$insertar="INSERT INTO datos(`nombre`, `cedula`, `Correo`, `telefono`, `ptd`)
VALUES ('".$_POST['Nombre']."','".$_POST['Identificacion']."','".$_POST['Email']."','".$_POST['Telefono']."','".$_POST['ptd']."')ON DUPLICATE KEY UPDATE nombre=nombre AND cedula=cedula AND Correo=Correo AND telefono=telefono and ptd=ptd;";
$resultado=mysqli_query($conexion,$insertar) or die ('Error en el query database- insertar datos');
but it gives me this mistake:
I need: if the value already is in the database do nothing and continue normally.