Results 1 to 5 of 5

Thread: if statement question

  1. #1
    votter is offline x10Hosting Member
    Join Date
    Mar 2008
    Posts
    34

    if statement question

    I was wondering if you were able to do an if statement which would be something like:

    if ($money == 5) and ($lvl == 3)

    Something like that, that's just an example, but was just wondering, or is it like:

    if($money == 5; $lvl == 3) ?

  2. #2
    Anna's Avatar
    Anna is offline I am just me
    Join Date
    Aug 2007
    Location
    Sweden
    Posts
    6,767

    Re: if statement question

    I'd say it's probably like the first, but with a slight difference:

    if ($money == 5 AND $lvl == 3) possibly if (($money == 5) AND ($lvl == 3))

  3. #3
    votter is offline x10Hosting Member
    Join Date
    Mar 2008
    Posts
    34

    Re: if statement question

    Ok, Thanks. :D. It is actually:

    (if $money == 5 && $level == 3)

    That's how it combines. :D.

  4. #4
    freecrm's Avatar
    freecrm is offline x10 Elder
    Join Date
    May 2008
    Location
    UK
    Posts
    629

    Re: if statement question

    Quote Originally Posted by votter View Post
    Ok, Thanks. :D. It is actually:

    (if $money == 5 && $level == 3)

    That's how it combines. :D.
    Cool - never knew that, I've always nested them like this:

    <?php if (something==somethingelse){?>
    <?php if (somethingelse==someone){?>
    something=somethingelse and also someone.
    <?php } else {?>
    somethingelse doesn't equal someone.
    <?php } ?>
    <?php } else {?>
    something does not equal somethingelse.
    <?php } ?>

    This wll solve a few problems!!

  5. #5
    votter is offline x10Hosting Member
    Join Date
    Mar 2008
    Posts
    34

    Re: if statement question

    LOL, Ya, that might make it a little shorter and easier. lol.

Similar Threads

  1. A question concerning advertisements.
    By jeremycollins in forum Free Hosting
    Replies: 2
    Last Post: 06-05-2008, 12:49 PM
  2. Lottery Website (kind of)
    By admintwo in forum Classifieds
    Replies: 4
    Last Post: 12-29-2007, 05:07 PM
  3. New Question on Limits.
    By adsensefun in forum Free Hosting
    Replies: 1
    Last Post: 11-15-2007, 06:02 PM
  4. Odd question but will I be banned for this?
    By sielk in forum Free Hosting
    Replies: 3
    Last Post: 09-28-2007, 11:29 AM
  5. An urgent question on ads to the admin/x10hosting CEO
    By lionheart8 in forum Free Hosting
    Replies: 3
    Last Post: 11-03-2006, 12:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
dedicated servers