Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 45
  1. #21
    Join Date
    Oct 2006
    Location
    Peterborough, UK
    Posts
    3,855
    Tokens
    216

    Latest Awards:

    Default

    Hey I'll even put in a custom function!

    $this->load_class( 'DB', 'Kernel' );


    visit my internet web site on the internet
    http://dong.engineer/
    it is just videos by bill wurtz videos you have been warned

  2. #22
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Jewish Bear View Post
    Hey I'll even put in a custom function!

    $this->load_class( 'DB', 'Kernel' );
    10/10 lol
    Lets set the stage on fire, and hollywood will be jealous.

  3. #23
    Join Date
    Sep 2005
    Location
    East London
    Posts
    3,028
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by PureG View Post
    PHP Code:
    <?PHP
    $knownSinner 
    mysql_query("SELECT * FROM `idiotlist` WHERE `username` = 'knownSinner'");
    if(
    mysql_num_rows($knownSinner) == 0) {
        print 
    "You are only lying to yourself...";
    } elseif(
    mysql_num_rows($knownSinner) > 0) {
        print 
    "Thats what i thought.";
    }
    ?>
    or

    PHP Code:
    <?PHP
    $knownSinner 
    mysql_query("SELECT * FROM `idiotlist` WHERE `username` = 'knownSinner'");
    $n mysql_num_rows($knownSinner);
    if(
    $n == 0) {
        print 
    "You are only lying to yourself...";
    } elseif(
    $n 0) {
        print 
    "Thats what i thought.";
    }
    ?>
    Wait.. So your saying my mysql could be better?

    Im very confused..

    Doing if(mysql_num_rows($knownSinner)){ is a longer way of counting the rows...

    the second one you have done almost exactly the same except added if($n >0).

    There was no need for an elseif as else works just fine.

  4. #24
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    whats the point though in using another if statement when you can use the one your alread y using?
    Hi, names James. I am a web developer.

  5. #25
    Join Date
    Oct 2005
    Location
    London :D
    Posts
    899
    Tokens
    0

    Default

    I don't see the point in brackets either... unless you are doing functions as in, or headers etc....

    function whatever($echo)


    ohhhh http://www.php.net/quickref.php
    PM ME FOR QUICK HELP ON WEBDESIGNING, CODING, AND COMPUTER PROBLEMS! I WILL BE GLAD TO HELP FOR FREE!

    I AM A GOLD HC MEMBER! 16 MONTHS! I have been on Habbo since the layout with the Newsie, and 14 of my articles were posted! I'm trusted when trading HC stuff for coding!


    Noob person (this is true):

  6. #26
    Join Date
    Aug 2005
    Location
    London
    Posts
    9,773
    Tokens
    146

    Latest Awards:

    Default

    PHP Code:
    <?php
      
    echo("I actually think it's much neater and clearer by having it with brackets surrounding the speech marks but that's just my personal opinion.");
    ?>
    Last edited by --ss--; 06-05-2008 at 07:31 PM.

  7. #27
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    I agree to that
    Hi, names James. I am a web developer.

  8. #28
    Join Date
    Sep 2005
    Location
    East London
    Posts
    3,028
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by PureG View Post
    whats the point though in using another if statement when you can use the one your alread y using?
    Your the one that did lol

    I had else{ and you put elseif{
    ...

  9. #29
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    if($x == 0) {
    // error
    } elseif($x > 0) {
    //succeed
    } else {
    // error
    }

    apposed to

    if($x == 0) {
    // fail
    } else {
    if($x > 0) {
    // succeed
    } else {
    // fail
    }
    }
    Hi, names James. I am a web developer.

  10. #30
    Join Date
    Oct 2006
    Location
    Peterborough, UK
    Posts
    3,855
    Tokens
    216

    Latest Awards:

    Default

    Quote Originally Posted by PureG View Post
    if($x == 0) {
    // error
    } elseif($x > 0) {
    //succeed
    } else {
    // error
    }

    apposed to

    if($x == 0) {
    // fail
    } else {
    if($x > 0) {
    // succeed
    } else {
    // fail
    }
    }
    Or you could just do
    if( $x >= 1 )
    {
    //success
    }
    else
    {
    //fail
    }


    visit my internet web site on the internet
    http://dong.engineer/
    it is just videos by bill wurtz videos you have been warned

Page 3 of 5 FirstFirst 12345 LastLast

Posting Permissions

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