key
is a reserved word which you're using in your query, this must be escaped with backticks. Reserved word error is 1064.
You should also consider learning some security theory particularly with regards to using unescaped values in a query (straight from a user).
The below code is both secure and fixed:
$username = mysql_real_escape_string($_POST['username']);
$password = mysql_real_escape_string($_POST['password']);
$email = mysql_real_escape_string($_POST['email']);
$sqlquery = "INSERT INTO `user` (`username`, `password`, `email`, `key`) VALUES ('{$username}','{$password}','{$email}','{$activation}')";
A simple rule when it comes to queries (well, anything) is to never trust user input. By using mysql_real_escape_string
you're escaping the variables so that they're safe for insertion into the database. Without it, you could allow the user to run any query that they wanted to.
For future reference, here is a complete list of MySQL Reserved Words.