mysqli : DELETE FROM tablename WHERE id - 1234;

ela

Well-known member
  • Jul 4, 2006
    6,425
    4,297
    113
    N/A
    Chrishan Ran Jayakody
    48 minutes ago near Colombo, Sri Lanka
    I sat at the MySQL console for the production web application database and typed:

    DELETE FROM tablename WHERE id - 1234;

    ...and hit return.

    Note that I typed "id - 1234", not "id = 1234".

    In MySQL the statement (value - value) is false if it evaluates to 0, and true if it evaluates to anything else. I just asked the database to delete all rows where the ID minus 1234 was not zero.

    It replied "80,000 rows deleted".

    The 16 Biggest Tech Intern Fails via Business Insider
    Like · · Share
    3 people like this.


    Source FB
     

    ela

    Well-known member
  • Jul 4, 2006
    6,425
    4,297
    113
    N/A
    :shocked::shocked:

    Chrishan is one of my friend

    Mokak :shocked: ooge friend list eka balapan maath innawa.
    11.gif
     

    kosandpol

    Well-known member
  • Jun 10, 2008
    45,329
    1,492
    113
    he should've used a mysql manager like phpmyadmin where delete statements get an automatic reconfirmation box. It could've saved those 80000 records.
     
    • Like
    Reactions: mjayanatha

    prazadx

    Well-known member
  • Sep 2, 2011
    2,008
    578
    113
    Gampaha
    hapoi :( mama nam kalinma backup ekak aragenai wedeta bahinne. karapu tikata kela unath kalin thibba point ekata hari badu have ne.