forked from ramchandra-guthula/devops-training
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathram.php
More file actions
24 lines (24 loc) · 744 Bytes
/
ram.php
File metadata and controls
24 lines (24 loc) · 744 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
<?php
$servername = "devops-app.cirfjiv0tncx.ap-south-1.rds.amazonaws.com";
$username = "admin";
$password = "Admin123";
$dbname = "devops";
$id = $_POST["id"];
$lastname = $_POST["lastname"];
$firstname = $_POST["firstname"];
$address = $_POST["address"];
$city = $_POST["city"];
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO persons VALUES ('$id','$lastname','$firstname','$address','$city')";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>