PHP внес на податоци во табела

HTML

<html>
<head>
<title>Moja WEB strana</title>

<head>
<body>

<form action = "baza_vnes.php" method = "GET">
Ime: <input type = "text" name = "ime" />
Prezime: <input type = "text" name = "prezime" />
Email: <input type = "text" name = "email" />

<input type = "submit" value="Vnesi"/>
</form>

</body>
</html>
 

baza_vnes.php

<?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "mojaDB";
// Kreiranje na konekcija
$conn = new mysqli($servername, $username, $password, $dbname);
// Proverka na konekcijata
if ($conn->connect_error) {
  die("Nema konekcija  " . $conn->connect_error);
}

$ime=$_GET['ime'];
$prezime=$_GET['prezime'];
//$klas=$_GET['klas'];
$email=$_GET['email'];

$sql = "INSERT INTO ucenici (ime, prezime, email) VALUES ('$ime', '$prezime', '$email')";

if ($conn->query($sql) === TRUE) {
echo "Nov slog kreiran uspesno ";
} else {
echo "Greska : " . $sql . "<br>" . $conn->error;
}

$conn->close();
?>