Good evening, I have a problem because I currently have two tables in mysql and at the time of making the query I can not make them show me all their data because I do not know how to relate them. The primary keys are CedulaAlumno and CedulaRepresentante, what happens with this? that the data will never be the same and therefore I do not know how to associate them to obtain the results. Here I leave the code and the screens of the database. Thank you very much.
PS: As you can see, I do not know where I should place the inner join if I should place it.
Table students
Representatives table
Then the code that I have so far:
<!DOCTYPE html>
<html>
<head>
<title>Consulta de Registros</title>
</head>
<body>
<?php
$Conexion = mysqli_connect("localhost", "root", "", "tesis") or die ("Problemas con la conexion");
$Registros = mysqli_query($Conexion, "select TipoCedulaAlumno, CedulaAlumno, PrimerApellidoAlumno, SegundoApellidoAlumno, PrimerNombreAlumno, SegundoNombreAlumno, FechaNacimientoAlumno, NacionalidadAlumno, EdadAlumno, SexoAlumno, DireccionAlumno, TelefonoAlumno, CorreoAlumno from alumnos where CedulaAlumno = '$_REQUEST[CedulaAlumno]'") or die ("Problemas en el select: ".mysqli_error($Conexion));
if ($Reg = mysqli_fetch_array($Registros))
{
echo "Cedula del Alumno: ".$Reg['TipoCedulaAlumno']." ".$Reg['CedulaAlumno']."<br>";
echo "Apellidos del Alumno: ".$Reg['PrimerApellidoAlumno']." ".$Reg['SegundoApellidoAlumno']."<br>";
echo "Nombres del Alumno: ".$Reg['PrimerNombreAlumno']." ".$Reg['SegundoNombreAlumno']."<br>";
echo "Fecha de Nacimiento del Alumno: ".$Reg['FechaNacimientoAlumno']."<br>";
echo "Nacionalidad del Alumno: ".$Reg['NacionalidadAlumno']."<br>";
echo "Edad del Alumno: ".$Reg['EdadAlumno']."<br>";
echo "Sexo del Alumno: ".$Reg['SexoAlumno']."<br>";
echo "Direccion del Alumno: ".$Reg['DireccionAlumno']."<br>";
echo "Telefono del Alumno: ".$Reg['TelefonoAlumno']."<br>";
echo "Correo del Alumno: ".$Reg['CorreoAlumno']."<br>";
}
else
{
echo "No se encontro un alumno con esa Cedula";
}
?>
</body>
</html>