-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathjudgeInsert.php
More file actions
31 lines (28 loc) · 806 Bytes
/
judgeInsert.php
File metadata and controls
31 lines (28 loc) · 806 Bytes
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
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "scdatabase";
$name=$_POST["j_id"];
$code=$_POST["j_name"];
$mobile=$_POST["j_designation"];
$email=$_POST["j_dob"];
$address=$_POST["j_doa"];
$charge=$_POST["j_dor"];
$acheivments=$_POST["j_nj"];
$about=$_POST["j_about"];
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO judges (id,name,designation,dob,doa,dor,nj,about)
VALUES ('$name','$code','$mobile','$email','$address','$charge','$acheivments','$about')";
if ($conn->query($sql) === TRUE) {
header("location:loggedinJudges.php");
} else {
echo"0";
}
$conn->close();
?>