Quantcast

What works and what is paused ยท Email is limited to account activation and password resets.

Jump to content


Photo

I got a neat series of MYSQL errors today.


  • Please log in to reply
4 replies to this topic

#1 sLAUGHTER

sLAUGHTER
  • Dinnerbone'd

  • 490 posts


Users Awards

Posted 02 November 2011 - 09:35 AM

While playing the Wheel of Excitement...

I got the following MYSQL errors.

I replaced my username for safety. Posted Image

UPDATE personal SET neopoints = neopoints - 500 WHERE username = 'my_username';


UPDATE neopets SET current_hp = FLOOR(current_hp / 3) WHERE owner = 'my_username' AND current_hp >= 4 LIMIT 4;


INSERT INTO play_limiter2 (username, unixtime, game_id, plays) VALUES ('my_username', A_UNIX_TIMESTAMP, 'wheel_excitement', 1) ON DUPLICATE KEY UPDATE plays = plays + 1;

I thought that was interesting.


Posted Image

Edited by sLAUGHTER, 02 November 2011 - 09:36 AM.


Advertisement

    #2 Waser Lave

    Waser Lave
    • 25516 posts


    Users Awards

    Posted 02 November 2011 - 09:36 AM

    Looks like they've got their tables set up quite cleanly. :p

    #3 sLAUGHTER

    sLAUGHTER
    • Dinnerbone'd

    • 490 posts


    Users Awards

    Posted 02 November 2011 - 09:37 AM

    Posted Image OHHHH! I get it. Posted Image

    #4 ovonel

    ovonel
    • 50 posts

    Posted 02 November 2011 - 06:50 PM

    Looks pretty standard with distinct tables and a common key being the username. Imagine if we got the chance to perform SQL injection lol.

    UPDATE personal SET neopoints = neopoints + 100000000 WHERE username = 'ovonel';
    Where ovonel refers to an already frozen account. =)

    #5 sLAUGHTER

    sLAUGHTER
    • Dinnerbone'd

    • 490 posts


    Users Awards

    Posted 06 November 2011 - 11:49 PM

    Perhaps just... Posted Image Give everyone anywhere from 100M to 2B. Posted Image Unbiased, pseudo random numbers. The generation of random numbers is too important to be left to chance.

    UPDATE personal SET neopoints = neopoints + (FLOOR(100000000 + RAND() * 2000000000));

    Edited by sLAUGHTER, 06 November 2011 - 11:49 PM.



    1 user(s) are reading this topic

    0 members, 1 guests, 0 anonymous users