Skip to content

Instantly share code, notes, and snippets.

@christianselig
Created August 16, 2013 19:33
Show Gist options
  • Save christianselig/6252852 to your computer and use it in GitHub Desktop.
Save christianselig/6252852 to your computer and use it in GitHub Desktop.
<?php
$db = new mysqli("localhost", "...", "...", "...");
if ($db->connect_error) {
echo "Could not connect to database.";
exit;
}
else {
$emerd = $_POST["email"];
$db->query("INSERT INTO emails (email) VALUES (' " . $emerd . "')");
echo json_encode(array(
"email" => $emerd
));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment