I was wondering Is this code safe form SQL injection and other types of exploits? If it is safe can anyone explain it to me how? And if isn't can anyone make corrections
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "form";
//Requesting values form form.html
$a = $_REQUEST['fname'];
$b = $_REQUEST['lname'];
$c = $_REQUEST['email'];
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " .$conn->connect_error);
}
// prepare and bind
$stmt = $conn->prepare ("INSERT INTO my_db (fname, lname, email)
VALUES (?, ?, ?)");
$stmt->bind_param("sss",$a,$b,$c);
$stmt->execute();
echo "new record created successfully";
$stmt->close();
$conn->close();
?>