-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubdegclg.php
34 lines (31 loc) · 989 Bytes
/
subdegclg.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
<?php
include("logic/connection.php");
include("logic/back.php");
if(isset($_POST['submit'])){
$deg=$_REQUEST['degree'];
$crs=$_REQUEST['crs'];
$clg=$_REQUEST['clg'];
$fees=$_REQUEST['fees'];
$crsid="";
$query0=mysqli_query($con,"select * from `deg_crs_clg` where degid='$deg' and crsid='$crs' and clgid='$clg'");
while($result=mysqli_fetch_assoc($query0)){
$degid=$result['degid'];
$crsid=$result['crsid'];
$clgid=$result['clgid'];
}
if($deg==$degid && $crs==$crsid && $clg==$clgid){
?>
<script>
alert("this data already exist");
document.location="degclg.php";
</script>
<?php
}else{
$query=mysqli_query($con,"INSERT INTO `deg_crs_clg` (`sid`, `degid`, `crsid`, `clgid`, `fee`) VALUES (NULL, '$deg', '$crs', '$clg', '$fees');");
}
}
?>
<script>
alert("succesfully inserted");
//document.location="degclg.php";
</script>