The parse error is because you need to call it in a different way:
$add_table = mysql_query("CREATE TABLE $tablename
( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
`pname` CHAR(40) NOT NULL,
`pposition` CHAR(40) NOT NULL,
`prole` CHAR(40) NOT NULL") or die(mysql_error());
But apart from that you must first select the database, then create the table. So you should rewrite your code to:
$link = mysql_connect ("localhost", $user, $pass) or die("Couldnt connect to the MySQL: ".mysql_error());
mysql_select_db ($db)
or die ("Couldnt open $db: ".mysql_error ());
$add_table = mysql_query("CREATE TABLE $tablename
( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
`pname` CHAR(40) NOT NULL,
`pposition` CHAR(40) NOT NULL,
`prole` CHAR(40) NOT NULL") or die(mysql_error());