I'm doing a school work that is just to check ratings I'm doing in php and I already have the login but when I click on my menu to show me my qualifications send me the following error I'm using Xampp I leave my code I guess my error is in the query when I want to send to call the user's qualifications that I start session ojala could help me with my query or how do I do the tour if in any of the two I'm wrong.
Line 58 of my code is just the one in the query:
$calf=mysql_query("'SELECT * FROM boleta WHERE CURP = $_SESSION['Usuario']'");
Error that appears in xampp:
Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in ...... on line 58
Code:
<?php
session_start();
$_SESSION['Usuario'];
include "./conexion.php";
$re=mysql_query("select * from user_alumno where CURP='".$_POST['Usuario']."' AND
CONTRASENA='".$_POST['Password']."'") or die(mysql_error());
while ($f=mysql_fetch_array($re)) {
$arreglo[]=array('Id'=>$_POST['id']);
}
if(isset($arreglo)){
$_SESSION['Usuario']=$arreglo;
header("Location: ../admin.php");
}else{
header("Location: ../login.php?error=datos no validos");
}
?>
<!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>REPORTES</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>Curp</td>
<td>Materia</td>
<td>Calificacion 1</td>
<td>Calificacion 2</td>
<td>Calificacion 3</td>
<td>Calificacion Final</td>
<td>Asistencia 1</td>
<td>Asistencia 2</td>
<td>Asistencia 3</td>
</tr>
<?php
if(isset($_POST['Usuario'])){
$calf= $_POST['id'];
$calf=mysql_query("'SELECT * FROM boleta WHERE CURP = $_SESSION['Usuario']'");
$result = mysql_query($calf);
if (mysql_num_rows($calf)>0) {
$row = mysql_fetch_array($result);
$_SESSION["Usuario"] = $row['id'];
$calf=$_POST['id'];
echo '<tr>
<td>'.$calf['CURP'].'</td>
<td>'.$calf['MATERIA'].'</td>
<td>'.$calf['CALIFICCION1'].'</td>
<td>'.$calf['CALIFICCION2'].'</td>
<td>'.$calf['CALIFICCION3'].'</td>
<td>'.$calf['CALIFICCION_FINAL'].'</td>
<td>'.$calf['ASISTENCIA1'].'</td>
<td>'.$calf['ASISTENCIA2'].'</td>
<td>'.$calf['ASISTENCIA3'].'</td>
</tr>';
}
}
?>