Skip to content

Instantly share code, notes, and snippets.

@domantasg
Created August 3, 2017 12:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save domantasg/7f41dfcc42913cc44d658a60913b163f to your computer and use it in GitHub Desktop.
Save domantasg/7f41dfcc42913cc44d658a60913b163f to your computer and use it in GitHub Desktop.
<?php
$servername = "mysql.hostinger.co.uk";
$database = "u266072517_name";
$username = "u266072517_user";
$password = "buystuffpwd";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $database);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
echo "Connected successfully";
$sql = "INSERT INTO Students (name, lastname, email) VALUES ('Thom', 'Vial', 'thom.v@some.com')";
if (mysqli_query($conn, $sql)) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
mysqli_close($conn);
?>
@Najfar
Copy link

Najfar commented Jul 7, 2022

good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment