-
Notifications
You must be signed in to change notification settings - Fork 0
/
dbupdate.php
186 lines (167 loc) · 4.79 KB
/
dbupdate.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<?php session_start();?>
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "srp";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$en= $_SESSION["login_id"];
if ($_POST['action'] == 'Name')
{
$name=$_POST['name'];
$sql = "update basic set name='$name' where id='$en'";
header("Location: create.php");
}
else if ($_POST['action'] == 'A1') {
//action for delete
$a1=$_POST['a1'];
$sql = "update basic set a1='$a1' where id='$en'";
header("Location: create.php");
}
else if ($_POST['action'] == 'A2') {
//action for delete
$a2=$_POST['a2'];
$sql = "update basic set age='$a2' where id='$en'";
header("Location: create.php");
}
else if ($_POST['action'] == 'A3') {
//action for delete
$a3=$_POST['a3'];
$sql = "update basic set age='$a3' where id='$en'";
header("Location: create.php");
}
else if ($_POST['action'] == 'A4') {
//action for delete
$a4=$_POST['a4'];
$sql = "update basic set age='$a4' where id='$en'";
header("Location: create.php");
}
else if ($_POST['action'] == 'Mail') {
//action for delete
$mail=$_POST['mail'];
$sql = "update basic set email='$mail' where id='$en'";
header("Location: create.php");
}
else if ($_POST['action'] == 'Phone') {
//action for delete
$phone=$_POST['phone'];
$sql = "update basic set mobile='$phone' where id='$en'";
header("Location: create.php");
}
else if ($_POST['action'] == 'ug') {
//action for delete
$ug=$_POST['ug'];
$sql = "update technical set ug='$ug' where id='$en'";
header("Location: create.php");
}
else if ($_POST['action'] == 'hsc') {
//action for delete
$hsc=$_POST['hsc'];
$sql = "update technical set hsc='$hsc' where id='$en'";
header("Location: create.php");
}
else if ($_POST['action'] == 'sslc') {
//action for delete
$sslc=$_POST['sslc'];
$sql = "update technical set sslc='$sslc' where id='$en'";
header("Location: create.php");
}
else if ($_POST['action'] == 'Tech') {
//action for delete
$tech=$_POST['tech'];
$sql = "update technical set area_of_interest='$tech' where id='$en'";
header("Location: create.php");
}
else if ($_POST['action'] == 'Project') {
//action for delete
$proj=$_POST['project'];
$sql = "update technical set project='$proj' where id='$en'";
header("Location: create.php");
}
else if ($_POST['action'] == 'Skill') {
//action for delete
$skill=$_POST['skill'];
$sql = "update nontechnical set skills='$skill' where id='$en'";
header("Location: create.php");
}
else if ($_POST['action'] == 'Award') {
//action for delete
$award=$_POST['award'];
$sql = "update nontechnical set awards='$award' where id='$en'";
header("Location: create.php");
}
else if ($_POST['action'] == 'extra') {
//action for delete
$extra=$_POST['extra'];
$sql = "update nontechnical set extra_curr='$extra' where id='$en'";
header("Location: create.php");
}
else if ($_POST['action'] == 'Hobby') {
//action for delete
$h=$_POST['hobby'];
$sql = "update nontechnical set hobbies='$h' where id='$en'";
header("Location: create.php");
}
else if ($_POST['action'] == 'Language') {
//action for delete
$lang=$_POST['lang'];
$sql = "update nontechnical set lang='$lang' where id='$en'";
header("Location: create.php");
}
else if ($_POST['action'] == 'Father') {
//action for delete
$f=$_POST['father'];
$sql = "update bio_data set father_name='$f' where id='$en'";
header("Location: create.php");
}
else if ($_POST['action'] == 'DOB') {
//action for delete
$d=$_POST['dob'];
$sql = "update bio_data set dob='$d' where id='$en'";
header("Location: create.php");
}
else if ($_POST['action'] == 'Gender') {
//action for delete
$g=$_POST['gender'];
$sql = "update bio_data set gender='$g' where id='$en'";
header("Location: create.php");
}
else if ($_POST['action'] == 'Nation') {
//action for delete
$n=$_POST['nation'];
$sql = "update bio_data set citizenship='$n' where id='$en'";
header("Location: create.php");
}
else if ($_POST['action'] == 'Status') {
//action for delete
$s=$_POST['status'];
$sql = "update bio_data set relationship='$s' where id='$en'";
header("Location: create.php");
}
else
{
}
if ($conn->query($sql) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $conn->error;
}
/*
$row = $result->fetch_assoc()
{
if ($row["user_name"]== $user && $row["password"] == $pwd)
{ session_start();
$_SESSION['login_id']= $row["id"];
$_SESSION['login_name']= $row["user_name"];
header("Location: home.php");
$sql2 = "insert into session values($_SESSION[login_id])";
if ($conn->query($sql2) === TRUE) {}
}
}*/
mysqli_close($conn);
?>