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 '(8), description VARCHAR(500), main VARCHAR(1), threa' at line 6"


Code:
<?php session_start(); error_reporting (E_ALL ^ E_NOTICE);

$username = $_SESSION['user'];
$threadname = $_POST['threadname'];
$description = $_POST['description'];
$create = $_POST['create'];

if($create)
{
if(isset($username))
{
if($threadname&&$description)
{
if(strlen($threadname)>=10)
{
if(strlen($description)>=10&&strlen($description)< =500)
{
$nospace = str_replace ("_", "_", $threadname);
$nospecial = preg_replace("/[^A-Za-z0-9]/","",$nospace);
$dbthreadname = $nospecial;

$con = mysql_connect("localhost","root","D00134152") or die("Could not connect!");
mysql_select_db("phpcomment", $con);

$sql = "CREATE TABLE $dbthreadname(
id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY(id),
username VARCHAR(50),
comment VARCHAR(500),
date TIMESTAMP(8),
description VARCHAR(500),
main VARCHAR(1),
thread VARCHAR(50))";
mysql_query($sql, $con)
or die(mysql_error());
$sql2 = "INSERT INTO $dbthreadname (id,username,comment,date,description,main,thread) VALUES ('','$username','','','$description','1','$threadn ame')";
mysql_query($sql2, $con)
or die(mysql_error());
mysql_close($con);

header('Location: forum.php');
}
else
{
echo("Thread description should be between 10 and 500 characters!");
}
}
else
{
echo("Thread name should be greater than 10 characters!");
}
}
else
{
echo("Please complete all fields!");
}
}
else
{
header('Location: forum.php');
}
}
else
{
echo("You do not have permission to be on this page!");
}
?>