[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

If statement syntax question

Posted on 2013-01-27
4
Medium Priority
?
267 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to dynamically set the form action using jQuery.
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 …

650 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