-
Notifications
You must be signed in to change notification settings - Fork 1
/
profile_update.php
44 lines (38 loc) · 1.24 KB
/
profile_update.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
<?php
session_start();
$user_id = $_POST['user_id'];
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$gender = $_POST['gender'];
$date_of_birth = $_POST['date_of_birth'];
$cnic = $_POST['cnic'];
$address = $_POST['address'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$university_name = $_POST['university_name'];
$study_program = $_POST['study_program'];
$current_semester = $_POST['current_semester'];
$password = $_POST['password'];
require_once 'connection.php';
$sql = "UPDATE users_table SET
first_name = '$first_name',
last_name = '$last_name',
gender = '$gender',
date_of_birth = '$date_of_birth',
cnic = '$cnic',
address = '$address',
email = '$email',
phone = '$phone',
university_name = '$university_name',
study_program = '$study_program',
current_semester = '$current_semester',
password = '$password'
WHERE user_id = $user_id";
$stmt = $conn->prepare($sql);
$stmt->execute();
if ($stmt->rowCount() > 0 ) {
exit('<h1>Update successful. <a href="index.php">Back</a></h1>');
}
else {
exit('System Error');
}