I need to show on my page the contents of a table according to the user who has logged in. I am including the connection and the consultations where I must access to show me the user's data, which are already loaded in the fields of the tables in the database.
Am I doing the queries and tables well to be displayed on my page?
<?php
session_start();
include "../conexion.php";
include "conexion.php";
$re=mysql_query("SELECT * FROM user_alumno
WHERE CURP='".$_POST['Usuario']."'
AND CONTRASENA='".$_POST['Password']."'") or die(mysql_error());
if(isset($arreglo)){
$_SESSION['Usuario']=$arreglo;
header("Location: ../admin.php");
}else{
header("Location: ../login.php?error=datos no validos");
}
$re=mysql_query("SELECT * FROM basico
WHERE CURP ='".$_POST['NOMBRE']."'
AND APELLIDO_PATERNO='".$_POST['APELLIDO_MATERNO']."' ")
$re2=mysql_query("SELECT * FROM basico WHERE CURP ");
$basico=0;
echo '<table border="0px" width="100%">';
while ($f=mysql_fetch_array($re)) {
if($basico !=$f['basico']){
echo '<tr><td>CURP: '.$f['basico'].' </td></tr>';
}
$basico=$f['basico'];
echo '<tr>
<td>'.$f['CURP'].'</td>
<td>'.$f['NOMBRE'].'</td>
<td>'.$f['APELLIDO_PATERNO'].'</td>
<td>'.$f['APELLIDO_MATERNO'].'</td>
</tr>';
}
echo '</table>';
$re=mysql_query("SELECT * FROM boleta WHERE CURP='".$_POST['Usuario']."'");
if(isset($arreglo)){
$_SESSION['Usuario']=$arreglo;
header("Location: ../admin.php");
}else{
header("Location: ../login.php?error=datos no validos");
}
$re=mysql_query("SELECT * FROM boleta WHERE CURP'".$_POST['CURP']."'
AND CALIFICACION1='".$_POST['CALIFICACION1']."'
AND CALIICACION2='".$_POST['CALIFICACION2']."'
AND CALIICACION3='".$_POST['CALIFICACION3']."'
AND CALIFICACION_FINAL='".$_POST['CALIFICACIONF']."'
AND ASISENCIA1='".$_POST['ASISTENCIA1']."'
AND CALIICACION2='".$_POST['CALIFICACION2']."'
AND ASISTENCIA3='".$_POST['ASISTENCIA3']."'");
//Falta la condicion del campo de BB.DD CURL
$re2=mysql_query("SELECT * FROM basico WHERE CURP=... ");
$boleta=0;
echo '<table border="0px" width="100%">';
while ($f=mysql_fetch_array($re)) {
if($basico !=$f['basico']){
echo '<tr><td>CURP: '.$f['basico'].' </td></tr>';
}
$basico=$f['basico'];
echo '<tr>
<td>'.$f['CURP'].'</td>
<td>'.$f['CALIFICACION1'].'</td>
<td>'.$f['CALIFICACION2'].'</td>
<td>'.$f['CALIFICACION3'].'</td>
<td>'.$f['CALIFICACIONF'].'</td>
<td>'.$f['ASISTENCIA1'].'</td>
<td>'.$f['ASISTENCIA2'].'</td>
<td>'.$f['ASISTENCIA3'].'</td>
</tr>';
}
echo '</table>';