Announcement

Collapse
No announcement yet.

userinfo

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • userinfo

    I have a userid and I need to know the usergroupid and membergroupids.

    Is there a function that I can pass the userid and it will return userinfo?

    Thanks
    Sig? What sig?

  • #2
    I don't think there is a separate function for that. Or at least I can't find it.

    This code will get the information you want:

    Code:
    $userinfo = $DB_site->query_first("SELECT userid, usergroupid, membergroupids FROM " . TABLE_PREFIX . "user WHERE userid = [color=red]X[/color]");
    Where X is the userid of the user.

    Now $userinfo will contain the user's userid, usergroupid, and membergroupids:

    $userinfo[userid]
    $userinfo[usergroupid]
    $userinfo[membergroupids]

    Comment


    • #3
      $userinfo = fetch_userinfo($userid);

      Then access $userinfo['usergroupid' and $userinfo['membergroupids']

      I suggest not using this in a loop though.

      Comment


      • #4
        Thanks to both of you.

        I wanted to get a permission based off the userid of posts.

        Will doing it this way add another query for every post on every page?
        Sig? What sig?

        Comment


        • #5
          Yes, it's an extra query with either method.

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...
          X