Thanks everyone, it seems to work now, below is my modified code:
create table questions
(
questionid int unsigned not null auto_increment primary key,
questiontxt varchar(255) not null
);
create table answers
(
questionid int unsigned not null references questions (questionid),
answerid int unsigned not null,
answertxt varchar(255) not null,
correct boolean not null,
primary key (questionid,answerid)
) engine=InnoDB;
However, I'm probably going to have to add another table as answerid cannot "auto_increment" due to only being allowed to have one auto column in each table.
If you can see anything wrong with the above that might cause me problems later please let me know. Also, to those that said you are only allowed one primary key, this is true, but the key can be made up from more than one column in the table.