Parse error: syntax error, unexpected T_VARIABLE in /home/abp/public_html/test/admin/addForum.php on line 36
This generally means that you forgot to put a semi-colon ( ; ) at the end of a line above the line with the problem. For example, it would be at the end of line 35 in this code.
The error codes in php are sorta self-explanatory once you get used to it and see them a few times. It's when they don't have any errors that you have to dig deeper 
PHP Code:
<?php
$forumName = $_POST['forumName'];
if(!$forumName)
echo "fail";
mysql_connect('localhost','username','password');
mysql_select_db('abp_main');
// if your first field was forumID, and the second was forumName
// in the original query, then you can use the one below. if it's different
// then uncomment the second one and remove the top
mysql_query('INSERT INTO forum_forums (forumName) VALUES(\''.$forumName.'\')');
// mysql_query("INSERT INTO forum_forums VALUES(NULL, '$forumName')");
$affectedRows = mysql_affected_rows();
$query1 = mysql_query("SELECT forumID FROM forum_forums WHERE forumName='$forumName'");
$forumData = mysql_fetch_assoc($query1);
$forumID = $forumData['forumID'];
$fo=fopen($forumID."/index.php","w");
$fileData = '<html>
<head>
<title>'.$forumName.' forum on ABP</title>
</head>
<body>
<table>';
/*<?php*/ // you already have php tags opened xD
/*
* you don't need to connect to the database again since you have already done so above. regardless if you open a new set
* of tags, the db connection stays open until the script is done executing, then it's closed, or you explicitly closed it yourself
* by mysql_close. you can remove the commented code below.
*/
// mysql_connect("localhost","abp_phpacc","q!4PTy@&8");
// mysql_select_db("abp_main");
$query2 = mysql_query("SELECT threadID, threadName, threadCreator FROM forum_threads WHERE forumID='$forumID'");
while($results = mysql_fetch_assoc($query))
{
// .= means to addon to the string. be careful though, if you dont have a string already defined, it will print a warning
$fileData .= "<tr><td><a href='$forumID/{$results['threadID']}'>{$results['threadName']}</a></td><td>Created by {$results['threadCreator']}</td></tr>";
// or
// $fileData .= '<tr><td><a href="'.$forumID.'/'.$results['threadID'].'">'.$results['threadName'].'</a></td><td>Created by '.$results['threadCreator'].'</td></tr>';
// whichever format you prefer.
}
/*?>*/ // same thing... it's okay, you're still learning :)
$fileData .= '</table>
</body>
</html>';
fwrite($fo,$fileData);
fclose();
header("Location: index.php");
?>
that should work
-xP