Created
December 28, 2020 03:19
-
-
Save barmgeat/304a159c272051d71235e25e9060eee5 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 = "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 to delete a record | |
$sql = "DELETE FROM MyGuests WHERE id=3"; | |
if ($conn->query($sql) === TRUE) { | |
echo "Record deleted successfully"; | |
} else { | |
echo "Error deleting record: " . $conn->error; | |
} | |
$conn->close(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment