Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>Document</title>
- </head>
- <body>
- <?php
- $serwer = "localhost";
- $login = "root";
- $haslo = "";
- $baza = 'klasa';
- $tabela = 'uczen';
- $conn = mysqli_connect($serwer, $login, $haslo, $baza);
- ?>
- <form method="post">
- <input type="text" name="id" id="">
- <input type="text" name="name" id="">
- <input type="text" name="surname" id="">
- <input type="text" name="address" id="">
- <input type="submit" value="">
- </form>
- <?php
- $id = $_POST['id'];
- $name = $_POST['name'];
- $surname = $_POST['surname'];
- $address = $_POST['address'];
- $sql = " UPDATE uczen SET name='$name', surname='$surname', address='$address' WHERE idUcznia='$id'";
- if (mysqli_query($conn, $sql)) {
- echo "Record updated successfully";
- } else {
- echo "Error updating record: " . mysqli_error($conn);
- }
- mysqli_close($conn);
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement