-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate.php
35 lines (27 loc) · 825 Bytes
/
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
<?php
session_start();
$tid=$_SESSION['username'];
$connection= mysqli_connect('localhost','root','');
$db=mysqli_select_db($connection,'minor');
$new=1;
$final="select * from faculty where username='$tid'";
$q=mysqli_query($connection,$final);
while($row = mysqli_fetch_assoc($q))
{
$c1=$row["c1"];
$c2=$row["c2"];
}
if($c1==0&&$c2==0)
{
$_SESSION['tt']="Please fill all your slots";
$final="update faculty set status='$new' where username='$tid'";
if(mysqli_query($connection,$final))
{ echo "Timetabe updated";
}
else
echo 'cant';
}
else
$_SESSION['tt']="Please fill all your slots";
header('Location:tt.php');
?>