You get that error because you're sending strings without quotes to the database. That works only if the destination field is of type number (any - double, int, what ever) and the value you're trying to insert/change is a number, aswell.
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
Query failed: 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 ''username', 'password', 'activated', 'online', 'email', 'status', 'tut', 'active' at line 1
The code is:
mysql_query("INSERT INTO `users` ('username', 'password', 'activated', 'online', 'email', 'status', 'tut', 'activecode')
VALUES ('$reg_username', '$randompassword', '0', '0', '$email', 'Alive', '0', '$code')");
if (mysql_affected_rows() != 1) die ('Query failed: '.mysql_error());
I have removed all other columns from the table.
The code is inserting into the only columns in the table in order.