#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    1
    Rep Power
    0

    Question Question on multiple if statements


    I'm attempting to setup a statement something along these lines

    if x is true and y is true then z is true
    if x is false and y is true then z is false
    if x is true and y is false then z is false
    if x is false and y is false then z is false


    and I'm not quite sure what syntax to use.

    Help please?
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,957
    Rep Power
    1045
    Hi,

    I'm not quite sure what you want. Do you want to set a variable z depending on two variables x and y? Then you'd simply use the logical "and":
    Code:
    z = x && y
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2009
    Posts
    41
    Rep Power
    10
    That to me sounded like 'help me with my homework please'

IMN logo majestic logo threadwatch logo seochat tools logo