Im in need of help again, Ive looked through this pice of code but I cant find the error. My knowledge of the mysql syntax is limited so any help would be nice.
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?
include "include/db_connection.php";
$db=@mysql_pconnect($db_HOST,$db_USER,$db_PASS);
@mysql_select_db($db_db) or die("DATABASE ERROR". mysql_error());
?>
<title>Insert</title>
</head>
<body>
<?
$cid=$POST['cid'];
$top=$POST['top'];
$subject=$POST['subject'];
$name=$POST['name'];
$email=$POST['email'];
$message=$POST['message'];
$date=date("Y-m-d H:i:s");
$sql="INSERT INTO forum
(pid,title,name,email,message,date) VALUES ($cid,'$subject','$name','$email','$message','$date')";
mysql_query($sql) or die ("Fel ".mysql_error());
$sql="UPDATE forum SET lastchange='$date',num_change=num_change+1 WHERE cid=$top";
mysql_query($sql) or die ("Fel ".mysql_error());
echo("youranswear has been posted");
?>
<a href="forum.php">Back to forum</a>
</body>
</html>
and the 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 1