-
-
Save achshar/6ef54cf5a6947850845b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if($_POST) { | |
$dbh = new PDO('mysql:dbname=reddit;host:localhost', 'root', '', array(PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING)); | |
$query = $db->prepare('INSERT INTO posts (title, subreddit) VALUES (?, ?)'); | |
$query->execute(array($_POST['title'], $_POST['subreddit'])); | |
} ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment