Posting to MySQLvia URL

Hi,

So I am making a table reservation system.

What I want to achieve:
Send values from ingame to database (MySQL)
Get those values from the MySQL Database
Send the Data via URL (domain.com/new.php?name=whatever)

So far in my website I have this:

<?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
  die("Connection failed: " . $conn->connect_error);
}

$sql = "INSERT INTO Reservations (username, tablenumber, time, date, isGroup)
VALUES (The data)";

if ($conn->query($sql) === TRUE) {
  echo "New record created successfully";
} else {
  echo "Error: " . $sql . "<br>" . $conn->error;
}

$conn->close();
?>

Does this look right? My experience with HTTP isn’t that good, however I think I have progressed ok so far and apologies if this isn’t in the right thread.