Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17
  1. #11
    Join Date
    Nov 2007
    Posts
    1,253
    Tokens
    150

    Latest Awards:

    Default

    You honestly think I / we care about benchmarks over a page of php. Charlie just don't even bother posting in this thread / anywhere on this forum as you clearly think you are better than most of the people here.

    It's the same reason you made unboxing videos for your apple gear, you always have to be one tier ahead of anyone else - your life revolves around you weltering in been better.


    www.fragme.co = a project.

  2. #12
    Join Date
    May 2008
    Posts
    605
    Tokens
    0

    Default

    So hypergeek just because he used brackets to make the code look nice and clean you think it is bad practice. It may slow a large script down a tad, maybe a few msi.. but not that much. If you still think this is the 'wrong' way to go I pity your life.

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

    Latest Awards:

    Default

    Quote Originally Posted by Hypertext View Post
    PHP Code:
    <?php
    include( 'config.php' );

    $id $_GET'id' ]; // i'll keep that

    if( is_numeric$id ) )
    {
        if( 
    mysql_query"UPDATE `downloads` SET `total` = `total` + 1 WHERE `id` = '$id'" ) )
        {
            if( 
    $mysqlQuery mysql_query"SELECT * FROM `downloads` WHERE `id` = '$id'" ) )
            {
                if( 
    mysql_num_rows$mysqlQuery ) > )
                {
                    if( 
    $mysqlFetch mysql_fetch_array$mysqlQuery ) )
                    {
                        
    // wayy
                        
    header'Location: ' $mysqlFetch'url' ] );
                    }
                    else
                    {
                        echo 
    'Error sxi no rows';
                    }
                }
                else
                {
                    echo 
    'Omg no rowzz';
                }
            }
            else
            {
                echo 
    'Like no accezz or errorz in dbazes';
            }
        }
    }
    else
    {
        
    // try not to use exit tbh its nasty (unless it rly satisfies you)
        
    echo 'Booby error';
    }
    ?>
    Just changed a few things, like that function is pointless as you verify that $_GET['id'] is numeric.

    I'd suggest making a db wrapper, and instead of all those if's just put it in they're functions. I'd change it to or die(mysql_error()) but dont want to right now.

    Oh and I changed echo's to not use parenthesis, again, and corrected the spelling of header().

    @Protege, remember about language constructs that they don't need parenthesis, and it is generally considered bad practice.. well thats what a guy on phpfreaks forums told me..



    @update: fixed quotes
    I dont see why you even try to make something better cause in all honesty, put mine against a MS timer without the function and I bet, it will be faster. ( not that I actually give a **** about a few ms's )

    OH MY GOD HE USES BRAKCETS OMG SUE HIM IM A CEO SUEE SUEE SUEE

    if( $noobAlert ) // BRACKETS OMG
    {
    findNoob( 'hypertext' ); // brackets..
    noobBin( 'hypertext' ); // brackets again! !
    echo 'Noob'; // <-- *** that looks out of place to me oh wait, it looks like you, out of ******* place.
    }

    if's just put it in they're functions

    Does that make sense to you guys? I swear if it does im ******ed or something.

    if( mysql_num_rows( $mysqlQuery ) > 0 )

    What was wrong with my method ard man?
    Hi, names James. I am a web developer.

  4. #14
    Join Date
    Nov 2006
    Location
    D?sseldorf
    Posts
    2,858
    Tokens
    2,256

    Latest Awards:

    Default

    thanks everyone

    +rep to everyone that posted code if i can.

    Just so you know, all the code etc and stuff i've been posting latley i'm making a mini private CMS for my local ATC.

    So far, i've managed, a mini profile system (need to set some kind of layout lol), mini news cms, download cms, rank system (shows what rank the person is on their profile), and alert system.

    I'm getting hang of it, i see realy how easy php is if you study it ;P
    Thanks
    Luke

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

    Latest Awards:

    Default

    No problem sxi thanks for rep.

    Found a picture of Charlie the CEO of WeBeg PLC, i'd be careful: http://img.4chan.org/b/src/1219173417951.jpg
    Hi, names James. I am a web developer.

  6. #16
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Protege View Post

    if( mysql_num_rows( $mysqlQuery ) > 0 )

    What was wrong with my method ard man?
    Two comparisons are slower than one.
    How could this hapen to meeeeeeeeeeeeeee?lol.

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

    Latest Awards:

    Default

    So your saying if its slower, theres no point using it?

    Its like you still trying to beat people @ the 100m sprint, it aint gunna happen.
    Hi, names James. I am a web developer.

Page 2 of 2 FirstFirst 12

Posting Permissions

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