Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "baza";
- // Create connection
- $conn = mysqli_connect($servername, $username, $password, $dbname);
- // Check connection
- if (!$conn) {
- die("Connection failed: " . mysqli_connect_error());
- }
- $Ime=$POST['Ime'];
- $Priimek=$POST['Priimek'];
- $enaslov=$POST['enaslov'];
- $geslo=$POST['geslo'];
- $sql = "INSERT INTO uporabnik (Ime, Priimek, enaslov, geslo)
- VALUES ('$Ime', '$Priimek', '$enaslov', '$geslo')";
- if (mysqli_query($conn, $sql)) {
- echo "New record created successfully";
- } else {
- echo "Error: " . $sql . "<br>" . mysqli_error($conn);
- }
- mysqli_close($conn);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement