Skip to content

Instantly share code, notes, and snippets.

@lithid
Created February 2, 2012 18:50
Show Gist options
  • Save lithid/1725087 to your computer and use it in GitHub Desktop.
Save lithid/1725087 to your computer and use it in GitHub Desktop.
$ndb = mysqli_connect (
'localhost',
'user',
'pw',
'db') or die ('Error connecting. Check yo factz!');
$output_form = false;
$content=$_POST['content'];
$content = "mysql_real_escape_string($content, $ndb)";
if (isset($_POST['submit'])) {
$query = "INSERT INTO table (content)" .
"VALUES ('$content')";
$result = mysqli_query($ndb, $query)
or die ('Error writing to database');
mysqli_close($ndb);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment