Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "niets";
- $password = "ook niets";
- $dbname = "nogeens niets";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $stmt = $dbh->prepare("INSERT INTO URLshort (ID, URL) VALUES (:ID, :URL)");
- $stmt->bindParam(':ID', $ID);
- $stmt->bindParam(':URL', $URL);
- // insert one row
- $ID = 'rickroll';
- $URL = 'neva gonna give u up';
- $stmt->execute();
- $conn->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement