2014-05-26, 05:50 PM
Pages: 1 2
2014-05-26, 06:25 PM
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..
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..
2014-05-26, 06:38 PM
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
PS. Thanks for the reply
2014-05-26, 07:05 PM
tid = thread ID
pid = post ID
fid = forum ID
uid = user ID
pid = post ID
fid = forum ID
uid = user ID
2014-05-26, 07:39 PM
+1 guyzzzz thanks very much.
2014-05-26, 07:43 PM
(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
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.
2014-05-27, 05:05 PM
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.
There are also places that use gid which is the usergroup id.
2014-05-28, 12:38 PM
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????
$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????
2014-05-28, 01:02 PM
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.
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, 01:11 PM
(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