?
Solved

If statement syntax question

Posted on 2013-01-27
4
Medium Priority
?
261 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 35

Accepted Solution

by:
Robert Schutt earned 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
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…
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 …
Suggested Courses

752 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