Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. When the CEO becomes a developer III

When the CEO becomes a developer III

Scheduled Pinned Locked Moved The Weird and The Wonderful
databasemysql
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    imagiro
    wrote on last edited by
    #1

    I'm sorry, but I found the next one: There is a file that shows some statistics. It is called via ajax from the index page once per second (so it produces already a lot of traffic anyway). This is a part of the code inside this file:

    $query = mysql_query("SELECT * FROM " . $table . "");
    $data = mysql_num_rows($query);

    $query2 = mysql_query("SELECT * FROM " . $table . " WHERE status = 'Online'");
    $data2 = mysql_num_rows($query2);

    $query3 = mysql_query("SELECT * FROM articels");
    $data3 = mysql_num_rows($query3);

    $query4 = mysql_query("SELECT * FROM user");
    $data4 = mysql_num_rows($query4);

    $query5 = mysql_query("SELECT * FROM posts");
    $data5 = mysql_num_rows($query5);

    $query6 = mysql_query("SELECT * FROM url where url !=''");
    $data6 = mysql_num_rows($query6);

    I totally lost my faith.

    J 1 Reply Last reply
    0
    • I imagiro

      I'm sorry, but I found the next one: There is a file that shows some statistics. It is called via ajax from the index page once per second (so it produces already a lot of traffic anyway). This is a part of the code inside this file:

      $query = mysql_query("SELECT * FROM " . $table . "");
      $data = mysql_num_rows($query);

      $query2 = mysql_query("SELECT * FROM " . $table . " WHERE status = 'Online'");
      $data2 = mysql_num_rows($query2);

      $query3 = mysql_query("SELECT * FROM articels");
      $data3 = mysql_num_rows($query3);

      $query4 = mysql_query("SELECT * FROM user");
      $data4 = mysql_num_rows($query4);

      $query5 = mysql_query("SELECT * FROM posts");
      $data5 = mysql_num_rows($query5);

      $query6 = mysql_query("SELECT * FROM url where url !=''");
      $data6 = mysql_num_rows($query6);

      I totally lost my faith.

      J Offline
      J Offline
      Jeroen De Dauw
      wrote on last edited by
      #2

      Obviously, this is a test to see how well your infrastructure holds up to DDoS attacks. No horror in that!

      Jeroen De Dauw
      Blog ; Wiki

      I R 2 Replies Last reply
      0
      • J Jeroen De Dauw

        Obviously, this is a test to see how well your infrastructure holds up to DDoS attacks. No horror in that!

        Jeroen De Dauw
        Blog ; Wiki

        I Offline
        I Offline
        imagiro
        wrote on last edited by
        #3

        Yes, and a test of my patience when he asks me again: 'Why is the serverload over 90?' :mad:

        1 Reply Last reply
        0
        • J Jeroen De Dauw

          Obviously, this is a test to see how well your infrastructure holds up to DDoS attacks. No horror in that!

          Jeroen De Dauw
          Blog ; Wiki

          R Offline
          R Offline
          richard_k
          wrote on last edited by
          #4

          1. You are 100% correct.. 2. It has even a more basic flaw than that.. it is very very fragile.. using 'Select *' is a surefire guarantee to invoke all kinds of downstream issues when the DB design changes. As a fail, it is admirably complete.

          I 1 Reply Last reply
          0
          • R richard_k

            1. You are 100% correct.. 2. It has even a more basic flaw than that.. it is very very fragile.. using 'Select *' is a surefire guarantee to invoke all kinds of downstream issues when the DB design changes. As a fail, it is admirably complete.

            I Offline
            I Offline
            imagiro
            wrote on last edited by
            #5

            Yes, and the whole software even more. As I wrote in another part of this 'series' he managed to do really everything wrong which is possible - in fact he wrote the How-Not-To of programming. I don't know where to start, so much he did wrong. E.g. there is no checking and no escaping of parameters, GET and POST parameters are written directly in the query. Depending on the PHP configuration is is possible to delete whole tables via SQL-injection. And, pretty nice, every user has an account with virtual money. But this will be part 4..

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups