Solved

If statement syntax question

Posted on 2013-01-27
4
242 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
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 and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now