assign a variable an array

0

I have the following problem I hope you can help me I have a page that will show me a user's qualifications that I started session, but I think I am wrongly assigning the variable to a session variable ie $ ticket = $ _ SESSION, I do not know if I I do not know how to assign the contents of my session variable to my variable, I already have the ratings in my bd, the fact is that when I try to load the page I print the table but its content is not what I am consulting does not appear and I think it's because I'm not assigning a value to my variable or I'm not doing well my question someone tell me how I can correct it ??? thanks :) I leave my code:

<?php 
session_start();
$_SESSION['Usuario'];
include "conexion.php";
?> 
<!DOCTYPE html>
<html lang="es">
<meta charset="utf-8"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
<head>
<link href="csscali.css" rel="stylesheet" type="text/css" />
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Calificaciones</title>
<link href="csscali" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="./css/estilos.css">
  <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
  <script type="text/javascript"  href="./js/scripts.js"></script>
</head>
<body>

<center><h1>CALIFICACIONES</h1></center>
   <?php mb_internal_encoding("UTF-8");
   mysql_query("SET NAMES 'utf8'"); ?>


  <table border="0px" width="100%"> 
    <tr>

      <td>Materia</td>
      <td>Calificación 1</td>
      <td>Calificación 2</td>
      <td>Calificación 3</td>
      <td>Calificación Final</td>
      <td>Asistencia 1</td>
      <td>Asistencia 2</td>
      <td>Asistencia 3</td>
    </tr> 
<?php
      $re=mysql_query("select * from boleta where CURP" );
    $boleta=$_SESSION['Usuario'];

      while ($f=mysql_fetch_array($re)) {
          if($boleta!=$f['boleta']){
            echo '<tr><td>alumno: '.$f['CURP'].' </td></tr>';
          }
          $reportes=$f['reportes'];
          echo '<tr>
            <td>'.$f['MATERIA'].'</td>
            <td>'.$f['CALIFICCION1'].'</td>
              <td>'.$f['CALIFICCION2'].'</td>
              <td>'.$f['CALIFICCION3'].'</td>
              <td>'.$f['CALIFICCION_FINAL'].'</td>
              <td>'.$f['ASISTENCIA1'].'</td>
              <td>'.$f['ASISTENCIA2'].'</td>
              <td>'.$f['ASISTENCIA3'].'</td>
          </tr>';
      }
    ?>

  </table>
</div>
</body>
</html>
    
asked by abdiel sandoval 23.06.2017 в 02:11
source

1 answer

0

Your problem is that you are defining the variable $_SESSION['Usuario'] but you are not giving it value, and then you are matching the variable $boleta to that variable and therefore both are empty.

Review the operation of the session variables so you can see how you should use them.

link

    
answered by 23.06.2017 в 09:33