Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = $_GET["svr"];
- $username = $_GET["usr"];
- $password = $_GET["pwd"];
- $dbname = $_GET["db"];
- $conn = mysqli_connect($servername, $username, $password, $dbname);
- // Check connection
- if (!$conn) {
- die("Connection failed: " . mysqli_connect_error());
- }
- $name = $_GET["name"];
- $genre = $_GET["genre"];
- $link = $_GET["link"];
- $coverlink = $_GET["coverlink"];
- $watched = $_GET["watched"];
- $rating = number_format($_GET["rating"], 2);
- $personalrating = number_format($_GET["personalrating"], 2);
- $sql = "INSERT INTO Movies (name, genre, link, coverlink, watched, rating, personalrating)
- VALUES ('$name', '$genre', '$link', '$coverlink', '$watched', '$rating', '$personalrating')";
- 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