Hola,
Andaba haciendo un sistema de registro de usuarios y me topé con el siguiente problema:
Al mandar submit obtengo este 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 '12, '-' 12)),NOW())' at line 2
La sintaxis que utilizo para insertar los datos es la siguiente:
Código PHP:
Ver originalif ($usuario !='' && $pw !='' && $email !='' && $nombre !='' && $genero !='' && $dia !='' && $mes !='' && $anio !='') {
$sql = "INSERT INTO usuarios (usuario,password,email,nombre,genero,ubicacion,lenguaje,fecha_nacimiento,fecha_ingreso) VALUES
('".$usuario."','".$pw."','".$email."','".$nombre."','".$genero."','".$ubicacion."','".$genero."',DATE(CONCAT(".$anio.", '-' ".$mes.", '-' ".$dia.")),NOW())";
echo "Registro Completo";
} else {
echo "Registro incompleto";
}
cabe mencionar que el campo fecha_nacimiento es de tipo DATE y fecha_ingreso DATETIME