When wanting to save the data entered in my form through a .php file, it warns me that I have a syntax error which I have not been able to detect. .................................
<?php
include_once('db.php')
$matricula=$_POST['matricula'];
$nombre=$_POST['nombre'];
$apellidos=$_POST['apellidos'];
$semestre=$_POST['semestre'];
$paraescolar=$_POST['paraescolar'];
$capacitacion=$_POST['capacitacion'];
$propedeutica=$_POST['propedeutica'];
$conducta=$_POST['conducta'];
$asistencia=$_POST['asistencia'];
$nombret=$_POST['nombret'];
$telefono=$_POST['telefono'];
echo "Los datos son: <br>";
echo "$matricula, $nombre, $apellidos, $semestre, $paraescolar,
$capacitacion, $propedeutica, $conducta, $asistencia,$nombret y $telefono";
$conectar=conn();
$sql="INSERT INTO alumnos (matricula, nombre, apellidos, semestre, paraescolar, capacitacion,
propedeutica, conducta, asistencia, nombret, telefono)
VALUES ($matricula, $nombre, $apellidos, $semestre, $paraescolar, $capacitacion,
$propedeutica, $conducta, $asistencia, $nombret, $telefono)";
$resul = mysql_query($conectar , $sql)or trigger_error("Query Failed SQL- Error: ".mysqli_error($conectar), E_USER_ERROR);
echo "$sql";
?>
If the interpreter tells you that there is a syntax error, believe me, there is a syntax error. So check your code well. Still don't see the error? Nothing happens, rest for a while, distract yourself a little... and then go back to the code, it is very possible that you will see it all at once.
In this case, it's because you forgot the
;
afterinclude_once
:A pretty big mistake, not only for committing it, but also for not knowing how to see it after telling you that there is a
sintax error
.