-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUpdate_Project.php
More file actions
91 lines (87 loc) · 2.36 KB
/
Update_Project.php
File metadata and controls
91 lines (87 loc) · 2.36 KB
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
<?php
$Project_No = filter_input(INPUT_POST, 'Project_No');
$Budget = filter_input(INPUT_POST, 'Budget');
$Start_Date = filter_input(INPUT_POST, 'Start_Date');
$End_Date = filter_input(INPUT_POST, 'End_Date');
if(!empty($Project_No ))
{
$host = "localhost";
$dbusername = "root";
$dbpassword = "";
$dbname = "DBMS_Project";
// Create connection
if(!empty($Budget) )
{
$conn = new mysqli ($host, $dbusername, $dbpassword, $dbname);
if (mysqli_connect_error()){
die('Connect Error ('. mysqli_connect_errno() .') '
. mysqli_connect_error());
}
else{
$sql = "Update project set Budget = ('$Budget') where Project_No = ('$Project_No')";
if ($conn->query($sql)){
echo "Record Updated Successfully\n";
}
else{
echo "Error: ". $sql ."
". $conn->error;
}
$conn->close();
}
}
else
{
echo "Full Name is Not Changed\n";
}
if(!empty($End_Date))
{
$conn = new mysqli ($host, $dbusername, $dbpassword, $dbname);
if (mysqli_connect_error()){
die('Connect Error ('. mysqli_connect_errno() .') '
. mysqli_connect_error());
}
else{
$sql = "Update project set End_Date = ('$End_Date') where Project_No = ('$Project_No')";
if ($conn->query($sql)){
echo "\n";
}
else{
echo "Error: ". $sql ."
". $conn->error;
}
$conn->close();
}
}
else
{
echo "Record Updated\n";
}
if(!empty($Start_Date))
{
$conn = new mysqli ($host, $dbusername, $dbpassword, $dbname);
if (mysqli_connect_error()){
die('Connect Error ('. mysqli_connect_errno() .') '
. mysqli_connect_error());
}
else{
$sql = "Update project set Start_Date = ('$Start_Date') where Project_No = ('$Project_No')";
if ($conn->query($sql)){
echo "\n";
}
else{
echo "Error: ". $sql ."
". $conn->error;
}
$conn->close();
}
}
else
{
echo "Start Date not Changed\n";
}
}
else
{
echo "Error\n";
}
?>