I have a data insertion problem,
This is my Code
<?php
if ($_POST['MM_insert']) {
$nombre = $_POST['nombre_alumno'];
$sa = $_POST['sexo'];
$dt = $_POST['documento_tipo'];
$nd = $_POST['num_documento'];
$fr = $_POST['Fecha_Registro'] = date('Y-m-d');
$cea = $_POST['correo_electronico'];
$da = $_POST['direccion_alumno'];
$ta = $_POST['telefono_alumno'];
$ta2 = $_POST['telefono_alumno2'];
$ma = $_POST['movil_alumno'];
$rt = $_POST['responsable_tipo'];
$rt2 = $_POST['responsable_tipo2'];
$nr = $_POST['nombre_responsable'];
$nr2 = $_POST['nombre_responsable2'];
$cr = $_POST['cedula_responsable'];
$cr2 = $_POST['cedula_responsable2'];
$mr = $_POST['movil_responsable'];
$mr2 = $_POST['movil_responsable2'];
$cer = $_POST['correo_electronico_resp'];
$cer2 = $_POST['correo_electronico_resp2'];
$cm = $_POST['comentario'];
$mes = $_POST['mes'];
$dia = $_POST['dia'];
$ano = $_POST['ano'];
$grupo = $_POST['grupo'];
$aula = $_POST['aula'];
$idpago = $_POST['id_pago'];
$pago_nomb = $_POST['plan_nombre'];
$edad = $_POST['edad_alumno'];
$creducida = $_POST['creducida'];
$inscr = $_POST['inscripcion'];
$password = $_POST['password'];
$nivel = '4';
$tcliente = 'Alumno';
$q = "INSERT into alumno ( nombre_alumno, sexo_alumno, documento_tipo, num_documento, Fecha_Registro, correo_electronico, direccion_alumno, telefono_alumno,telefono_alumno2, movil_alumno, responsable_tipo,responsable_tipo2, nombre_responsable, nombre_responsable2, cedula_responsable,cedula_responsable2, movil_responsable, movil_responsable2, correo_electronico_resp,correo_electronico_responsable2, comentario,mes, dia, ano, grupo, aula, id_pago, plan_nombre, edad_alumno, creducida,inscripcion, password, nivel,tipo_cliente) VALUES ('$nombre', '$sa', '$dt','$nd','$fr', '$cea', '$da', '$ta','$ta2','$ma', '$rt',$rt2','$nr','$nr2','$cr','$cr2','$mr', '$mr2','$cer','$cer2', '$cm','$mes','$dia','$ano','$grupo','$aula','$idpago','$pago_nomb','$edad','$creducida','$inscr','$password','$nivel','$tcliente')";
$r = $conexion - > query($q) or die(mysqli_error($conexion));
}
?>
Launches the following error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '','aaaaaa','cccccc','1234567890','0987654321','1234567890', '0987654321','aaa@em' at line 1
But I understand that everything is correct, any suggestions? Thanks