-
Notifications
You must be signed in to change notification settings - Fork 0
/
accstudent.php
30 lines (28 loc) · 992 Bytes
/
accstudent.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
<?php
include('connection.php');
$username=$_REQUEST['username'];
echo $username;
$qry=mysqli_query($con,"SELECT * FROM `reqstudent` WHERE `username`='".$username."';");
if(!$qry)
{
echo "Not";
}
$row=mysqli_fetch_assoc($qry);
$q='INSERT INTO `student` (`course`,`dept`,`dob`,`email`,`fname`,`lname`,`password`,`secq`,`seca`,`gender`,`username`,`yr_passing`,`file`)
VALUES ("'.$row["course"].'","'.$row["dept"].'","'.$row["dob"].'","'.$row["email"].'","'.$row["fname"].'","'.$row["lname"].'","'.$row["password"].'","'.$row["secq"].'","'.$row["seca"].'","'.$row["gender"].'","'.$row["username"].'","'.$row["yr_passing"].'","'.$row["file"].'");';
if(mysqli_query($con,$q))
{
echo"successful";
$r='DELETE FROM `reqstudent` WHERE `username`="'.$username.'"';
$result=mysqli_query($con,$r);
header("Location:chkstudent.php");
if(!$result)
{
echo"NOT DELETED";
}
}
else
{
echo"not inserted";
}
?>