Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <meta charset="utf-8">
- </head>
- <body>
- <center>
- <h1>Wstawianie do tabeli</h1>
- <form action="index.php" method="get">
- Ocena: <input type="text" name="ocena"><br/>
- Waga: <input type="text" name="waga"><br/>
- Opis: <input type="text" name="opis"><br/>
- Osoba: <input type="text" name="osoba"><br/>
- <input type="submit" value="Wstaw">
- </form>
- <?php
- $ocena=$_GET['ocena'];
- $waga=$_GET["waga"];
- $opis=$_GET["opis"];
- $osoba=$_GET["osoba"];
- /*
- $servername = "localhost";
- $username = "admin";
- $password = "admin";
- $dbname = "oceny";
- $conn = new mysqli($servername, $username, $password, $dbname);
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "INSERT INTO oceny (ID_pol, ocena, waga, opis, osoba)
- VALUES ('', '$ocena', '$waga', '$opis', '$osoba')";
- if ($conn->query($sql) === TRUE) {
- echo "New record created successfully";
- } else {
- echo "Error: " . $sql . "<br>" . $conn->error;
- }
- $conn->close();
- */?>
- </center>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement