Solved

If statement syntax question

Posted on 2013-01-27
4
247 Views
Last Modified: 2013-01-27
Hey guys,

I'm having a little trouble adding  more than 1 usergroup to this if statement. How could I alter this so that it I can select usergroup not equal to 1,2 and 5.

if (Phpfox::getUserBy('user_group_id') != 1)

Open in new window



Thank you!
0
Comment
Question by:TLN_CANADA
  • 2
  • 2
4 Comments
 
LVL 35

Accepted Solution

by:
Robert Schutt earned 500 total points
ID: 38824754
Try putting it in a variable:
$grp = Phpfox::getUserBy('user_group_id');
if ($grp != 1 && $grp != 2 && $grp != 5)

Open in new window

0
 

Author Comment

by:TLN_CANADA
ID: 38824826
Thank you very much Robert! Works perfectly.

No worries at all if you don't have the time but I'm really stuck with a javascript question and if you had some time to take a look at it that would be greatly appreciated.

http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28009982.html
0
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 38824886
sorry, I've seen that one, gave it a try but couldn't get it to work the way you want.
0
 

Author Comment

by:TLN_CANADA
ID: 38824888
no worries Robert, thanks for trying :)
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question