Friends I'm new to php .. I have a mysql statement that does not give me a php function, I execute it in mysql and if it executes me in the function it does not. Also the data arrives at the function and all I do not do is run the mysql semtencia
function RegistrarUsuario($smallnameusuario,$contraseñausuario)
{
$mensaje = "";
if(isset($smallnameusuario,$contraseñausuario))
{
$tipoUsuario = 1;
//$currDate = getDate(); // generas un llamado al metodo
$fecharegistro = date("Y-m-d");
$idpersona = ObtenerUltimaPersona();
$eliminadologico = 1;
echo "Usuario: ".$smallnameusuario.", ";
echo "Contraseña: ".$contraseñausuario.", ";
echo "Tipo: ".$tipoUsuario.", ";
echo "Fecha: ".$fecharegistro.", ";
echo "ID Persona: ".$idpersona.", ";
echo "Eliminado logico: ".$eliminadologico.". ";
$query2 = "INSERT INTO registro(idpersona, idtipousuario, nombreusuario, contraseña, fecharegistro, eliminadologicor) VALUES ('".$idpersona."','".$tipoUsuario."','".$smallnameusuario."','".$contraseñausuario."','".$fecharegistro."','".$eliminadologico."')";
$con2 = conexionBD();
$accion2 = mysqli_query($con2,$query2);
if($accion2)
{
$mensaje= "Correcto";
}else
{
$mensaje= "No se pudo ejecutar la acción";
}
}else
{
$mensaje = "Los datos no fueron recibidos correctamente";
}
echo $mensaje;
return $mensaje;
}
The echos that are there I put them in to confirm that I was entering the function. the idpersona is obtained with another function that executes.