Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "username";
- $password = "password";
- $dbname = "id9639884_zupki";
- // Create connection
- $conn = mysqli_connect($servername, $username, $password, $dbname);
- // Check connection
- if (!$conn) {
- die("Connection failed: " . mysqli_connect_error());
- }
- if(isset($_GET["zupka"]) && isset($_GET["ocena"]) && isset($_GET["opis"]))
- {
- $zupka = $_GET["zupka"];
- $ocena = $_GET["ocena"];
- $opis = $_GET["opis"];
- $sql = "INSERT INTO 'Oceny zupek' (Nazwa, Ocena, Opis)
- VALUES ('".$zupka."', '".$ocena."', '".$opis."')";
- if ($conn->query($sql) === TRUE) {
- echo "Dodano zupkę!";
- } else {
- echo "Error: " . $sql . "<br>" . $conn->error;
- }
- } else
- {
- echo "Error: brak argumentu";
- }
- $conn->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement