Code:
<?php
$username = "cms";
$password = "***INSERT PASS HERE****";
$hostname = "localhost";
$dbh = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
print "Connected to MySQL<br>";
// make CMS the current db
mysql_select_db('CMS');
or die ("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('CMS');
?>
I keep getting errors. I keep trying so..can someone show me what I'm doing wrong..and yes I knowq the code is a mess..I don't need clean code as of now..jsut functional code..>.
<