I get this error message: Insert Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'testing this thing again' at line 2
NOTE: the 'testing this thing again' is $body
This is my MySQL setup.
CREATE TABLE `articles` (
`id` int(20) NOT NULL auto_increment,
`loginid` varchar(19) NOT NULL,
`title` varchar(25) NOT NULL,
`author` varchar(30) NOT NULL,
`body` text NOT NULL,
`date` date default NULL,
`category` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=latin1 AUTO_INCREMENT=16 ;
$db="xxxxxx";
$link = mysql_connect('xxxxx.xxxxxx.com', 'xxxxx','xxxxxx');
if (! $link) die(mysql_error());
mysql_select_db($db , $link) or die("Select Error: ".mysql_error());
$result=mysql_query("INSERT INTO articles (`loginid`,`title`,`author`,`body`,`date`,`category`)
VALUES ('".$loginid."','".$title."','".$author.",'".$body."','".$today."','".$category."')")
or die("Insert Error: ".mysql_error());
mysql_close($link);
print "Record added\n";
Any help is appreciated!