-
Notifications
You must be signed in to change notification settings - Fork 0
/
notasAlumno.php
54 lines (46 loc) · 1.88 KB
/
notasAlumno.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html lang="ca">
<head>
<title>Alta Alumno</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<form action='gestion.php' method='post'>
<div class="combo">
<h3>Alta Alumno</h3>
<?php
$mysqli = new mysqli
( "localhost" , "root" , "roflmao1" , "ESCOLA_DB");
if ($mysqli -> connect_errno) {
echo "problema al connectar MySQL: " . $mysqli -> connect_error;
}
$sentencia = $mysqli -> prepare("SELECT NOM_ASSIGNATURA,
ID_ASSIGNATURA
FROM ASSIGNATURA ASS
INNER JOIN CURS C
ON ASS.CURS_ID = C.ID_CURS
INNER JOIN ALUMNE AL
ON AL.CURS_ID = C.ID_CURS
WHERE AL.ID_ALUMNE = ?)");
$sentencia->bind_param("s", $id_curs);
$porciones = explode(" ", $_POST['notasAl']);
$id_curs = $porciones[2];
$sentencia->execute();
$sentencia->bind_result($nom_assignatura, $id_assignatura);
while ($sentencia->fetch())
{
echo '<br>';
echo $nom_assignatura;
echo '<br>';
echo $id_assignatura;
}
?>
<br>
<br>
<input id="altaAlumno" name='altaAlumno' type='submit' value='Guardar' class='btn btn-primary'>
</div>
</form>
</body>
</html>