Syntax Error after adding FOREIGN KEY REFERENCE
Try:

...
poster int references user(userid)
...


E.g.

mysql&gt; create table user ( uname varchar(15) primary key ) ;
Query OK, 0 rows affected (0.01 sec)


mysql&gt; create table note (
    -&gt;   title int primary key
    -&gt; , poster int references user(userid)
    -&gt; );
Query OK, 0 rows affected (0.00 sec)


Or ...

alter table note
add constraint user_fk
foreign key (poster) references user(uname);


E.g.

mysql&gt; create table user ( uname varchar(15) primary key ) ;
Query OK, 0 rows affected (0.00 sec)

mysql&gt; create table note (
    -&gt;   title int primary key
    -&gt; , poster varchar(15)
    -&gt; );
Query OK, 0 rows affected (0.00 sec)

mysql&gt; alter table note
    -&gt; add constraint user_fk
    -&gt; foreign key (poster) references user(uname); 
Query OK, 0 rows affected (0.01 sec)
Records: 0  Duplicates: 0  Warnings: 0