anonymous
2011-08-15 16:25:20 UTC
This file then processes that form:
$con = mysql_connect("localhost","username","password");
mysql_select_db("dbname", $con);
$sql="INSERT INTO `dbname`.`NEWSLETTER` (
`id` ,
`name` ,
`email`
)
VALUES (NULL , '$_POST[name]', '$_POST[email]'";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "You were added to the EvilDroid Newsletter list.";
mysql_close($con);
This code then returns this error:
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 '' at line 6
Any help will be much appreciated.