Advanced Search

Results 1 to 2 of 2

Thread: Help with a query

  1. #1
    Join Date
    Jan 2009
    Posts
    14
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Help with a query

    I use the script photopost gallery and need a query to show usergroup level for the members.

    I have this query

    Code:
    $query = "SELECT groupname FROM {$Globals['pp_db_prefix']}usergroups WHERE groupid=$usergroup";
    $nomegrupo = ppmysql_query("SELECT groupname FROM {$Globals['pp_db_prefix']}usergroups WHERE groupid=$usergroup", $link);
    if($nomegrupo)
    {
    list( $usergroup ) = mysql_fetch_row($nomegrupo);
    }
    This works, but have a problem!

    For example if I make the login show my usergroup level [administrator] in all members. And show the same if login like a regular user. Only change the usergroup level for example show [gold] in all.

    Can help me, please!

    Thanks and sorry for my poor english.

  2. #2
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    1,681
    Thanks
    78
    Thanked 89 Times in 87 Posts

    Default

    Code:
    if($nomegrupo)
    {
    list( $usergroup ) = mysql_fetch_row($nomegrupo);
    }
    is the same as
    Code:
    list( $usergroup ) = mysql_fetch_row($nomegrupo);
    If you are trying to display all entries except where the user level is administrator try amending your queries to something like:
    Code:
    $nomegrupo = "SELECT groupname FROM {$Globals['pp_db_prefix']}usergroups 
    WHERE groupid=$usergroup AND groupid NOT LIKE '$private'";
    where $private is the value you do not want pulled from the database.
    To choose the lesser of two evils is still to choose evil. My personal site

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •