-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcinsert.php
36 lines (32 loc) · 921 Bytes
/
cinsert.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
36
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "scdatabase";
$cno=$_POST["cno"];
$slci=$_POST["slci"];
$dno=$_POST["dno"];
$ctitle=$_POST["ctitle"];
$pname=$_POST["pname"];
$rname=$_POST["rname"];
$fees=$_POST["cfees"];
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO caveat (cavno,slci,diaryno,cause,padvo,radvo,cfees)
VALUES ('$cno','$slci','$dno','$ctitle','$pname','$rname','$fees')";
if ($conn->query($sql) === TRUE ) {
echo "<script>
alert('New Recoed Created Successfully');
window.location.href='loggedincaveat.html';
</script>";
} else {
echo "<script>
alert('Case already Exhist');
window.location.href='loggedincaveat.html';
</script>";
}
$conn->close();
?>