Created
August 3, 2017 12:24
-
-
Save domantasg/7f41dfcc42913cc44d658a60913b163f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
good