fid= forum id
tid= thread id
pid= post id
You'll need a forums table, threads table, and posts table.
The forums table needs a fid column so it can be referenced.
The threads table needs a fid column AND a tid column so it knows which forum it belongs to, and can be referenced.
The posts table needs a fid colum and a tid column so it knows which forum and which thread it belongs to. It also needs a pid column so you can reference each post.
Hopefully that's not too confusing. It's pretty straight forward, really.