Try:
PHP Code:
<?php
$username = "cms";
$password = "CENSORED";
$hostname = "localhost";
$dbh = mysql_connect($hostname, $username, $password);
if (!$dbh)
{
echo 'Unable to connect';
}
print "Connected to MySQL<br>";
// make CMS the current db
$db = mysql_select_db('CMS');
if (!$db)
{
print "Unable to connect to CMS";
}
print "Connected to CMS";
$comments = mysql_real_escape_string($_GET['comments']);
$body = mysql_real_escape_string($_GET['body']);
$title = mysql_real_escape_string($_GET['title']);
mysql_query("
INSERT INTO articles (articlename , body , comments) values ('$title', '$body', '$comments'
");
mysql_close("$dbh");
?>