-
Notifications
You must be signed in to change notification settings - Fork 3
/
admin_student_update_results.php
54 lines (39 loc) · 1.86 KB
/
admin_student_update_results.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
<?php
include "DBconnection.php";
if (isset($_POST['updatedata'])){
$id = $_POST['update_id'];
$studentresult_id = $_POST['studentresult_id'];
$student_id = $_POST['student_id'];
$batch_id = $_POST['batch_id'];
$subject1_results = $_POST['subject1_results'];
$subject2_results = $_POST['subject2_results'];
$subject3_results = $_POST['subject3_results'];
$subject4_results = $_POST['subject4_results'];
$subject5_results = $_POST['subject5_results'];
$subject6_results = $_POST['subject6_results'];
$subject7_results = $_POST['subject7_results'];
$subject8_results =$_POST['subject8_results'];
$subject9_results = $_POST['subject9_results'];
$subject10_results = $_POST['subject10_results'];
$final__status = $_POST['final__status'];
$query = "UPDATE students_results SET studentresult_id='$studentresult_id', student_id='$student_id', batch_id='$batch_id', subject1_results='$subject1_results', subject2_results='$subject2_results', subject3_results='$subject3_results', subject4_results='$subject4_results' , subject5_results='$subject5_results', subject6_results='$subject6_results', subject7_results='$subject7_results', subject8_results='$subject8_results', subject9_results='$subject9_results' , subject10_results='$subject10_results', final__status='$final__status' WHERE studentresult_id= $studentresult_id " ;
$query_run = mysqli_query($conn, $query);
if($query_run)
{
echo "submitted";
header('location:admin_students_results.php') ;
}
else
{
echo "form not submitted";
}
}
?>
<?php
$mysqli = new mysqli('localhost','root','','greendale') or die(mysqli_error($mysqli));
if (isset($_GET['delete'])) {
$studentresult_id = $_GET['delete'];
$mysqli->query("DELETE FROM students_results WHERE studentresult_id=$studentresult_id") or die ($mysqli->error());
header("location:admin_students_results.php");
}
?>