|
|
Joined: Apr 2001
Posts: 186
Member
|
Member
Joined: Apr 2001
Posts: 186 |
i have written a script that vill only show some groups in showmembers.php but it doesnt work like i hoped for.. <br /> $query = " <br /> SELECT U_Username,U_Laston,U_Extra1,U_Homepage,U_TotalPosts,U_Status,U_Number,U_Groups<br /> FROM {$config['tbprefix']}Users<br /> WHERE U_Approved = 'yes'<br /> AND U_Number <> 1<br /> AND U_Groups = '-5-'<br /> OR U_Groups = '-6-'<br /> OR U_Groups = '-5-2-'<br /> OR U_Groups = '-6-2-' i putted this in AND U_Groups = '-5-'<br /> OR U_Groups = '-6-'<br /> OR U_Groups = '-5-2-'<br /> OR U_Groups = '-6-2-' Cant that be done simpler ?? so it just show´s groups 2, 5 and 6 ??? some how this mess up the sorting... Thomas
|
|
|
|
Joined: Apr 2002
Posts: 1,768
Addict
|
Addict
Joined: Apr 2002
Posts: 1,768 |
I think this is the simplest way:
AND (U_Groups LIKE '%-2-%' OR U_Groups LIKE '%-5-%' OR U_Groups LIKE '%-6-%')
The way you were doing it is not reliable, since there's no guarantee that the groups will be listed in any particular order. E.g., U_Groups could be '-5-2-' or '-2-5-'.
I also added parentheses (), to ensure that the OR's get evaluated before the AND.
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 417
Joined: November 2001
|
|
Forums63
Topics37,575
Posts293,930
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|
|