Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- </head>
- <body>
- <form action="delete.php" method="post">
- id: <input type="text" name="id">
- <input type="submit" value="ok">
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "uni";
- $conn = new mysqli("localhost","root","",'uni');
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "DELETE FROM student WHERE id=3";
- if ($conn->query($sql) === TRUE) {
- echo "successful";
- } else {
- echo "error: " . $conn->error;
- }
- $conn->close();
- ?>
- </form>
- </body>
- </html>
Add Comment
Please, Sign In to add comment