MyBB Community Forums

Full Version: What is, FID, TID, PID, UID and so on?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I am learning all this stuff and I need someone to tell me what is:

post, thread, forum.

FID
TID
PID
UID


Are the more similar to these????
Forum ID
Thread ID
Post ID
User ID

Post = A post such as this
Thread = A thread is like this so people can reply.
Forum = General Help, Mybb 1.6 etc..
What is the difference between $post['tid'] and $post['pid'], $post['fid'] or $post['uid'] or I am going in the wrong direction.

PS. Thanks for the reply Smile
tid = thread ID
pid = post ID
fid = forum ID
uid = user ID
+1 guyzzzz thanks very much.
(2014-05-26, 06:38 PM)marcus123 Wrote: [ -> ]What is the difference between $post['tid'] and $post['pid'], $post['fid'] or $post['uid'] or I am going in the wrong direction.

PS. Thanks for the reply Smile

Hmm I know: $_POST is a global php variable for post requests.

I am not sure where you getting the code but I am assuming

$post is an array for tid and stuff

so possibly:

foreach($post['tid] as $x)
{
echo $x;
}

That would be my guess at least.
Also a hint is that most things that end with "id" tend to be the primary key of a table and a key or part of a key for additional tables that use that field. This matters when dealing with optimization.

There are also places that use gid which is the usergroup id.
I guess this is correct: $forum['fid'] and $forum['tid']

$forum['pid'] is not correct right?????

$thread['pid'] and $thread['tid'] and $thread['fid'] correct!

$post['pid'] and $post['tid'] correct!

$post['fid'] is not correct!

How do you know when to use them????
It isn't logical for the forum variable to ever have a post id. The only post id of any relevance is the last post id for that forum. That would be accessed with $forum['lastpostpid'] if I am remembering the field name correctly.

Normally posts won't ever need to know what forum they are in because you always query the thread the post resides in first to figure out which forum it is in and if the thread itself is moderated or not.

You also just need to learn how to read PHP and SQL.
(2014-05-28, 12:38 PM)marcus123 Wrote: [ -> ]$forum['pid'] is not correct right?????

Correct, because a forum does not have an associated post.

(2014-05-28, 12:38 PM)marcus123 Wrote: [ -> ]$post['fid'] is not correct!
That should work, I (seem to be) using it without problems.

One thing that you need to keep in mind is that $post contains both fid (forum ID) and fid# (Where # is a number). Fid# refers to the custom profile fields that a user has set, so $post['fid5'] will contain the value of the custom profile field with the ID of 5 for the user that made the post.
Pages: 1 2