One of those "Doh!" moments

Discussion in 'Indie Related Chat' started by Desktop Gaming, Jan 23, 2009.

  1. Desktop Gaming

    Moderator Original Member Indie Author

    Joined:
    Feb 24, 2005
    Messages:
    2,295
    Likes Received:
    12
    Spent a couple of days rewriting a PHP script to take a bunch of XML data from Reflexive's XML feed, and dump the data into a couple of SQL tables.

    Anyway, I finished it up and tidied up a few uglies in the database structure, all working perfectly.

    Over the next few days I ran my script and noticed that my site wasn't updating with the new games. I let it slide as I figured maybe the XML feed isn't updated every day.

    After three days of this, I decided to investigate further before posting here to ask about how often this thing was updated. It was then that I noticed I'd added underscores to two table names in the SQL database, and as such, the script was trying to add data to tables that no longer existed.

    Three days! Bloody thing didn't even throw an error!

    DOH!
     
  2. mot

    mot
    Indie Author

    Joined:
    Oct 21, 2004
    Messages:
    439
    Likes Received:
    0
    Right, bloody PHP sucks at stuff like this. They do have exceptions now
    I think, but they never throw from library functions. And each set of library
    functions has a different way to report errors. Bah! Use Python or ASP.NET for
    website stuff.
     
  3. Desktop Gaming

    Moderator Original Member Indie Author

    Joined:
    Feb 24, 2005
    Messages:
    2,295
    Likes Received:
    12
    I do actually like PHP. I guess if I'd bothered to echo out the query and test it in PHPMyAdmin like I normally do, I would've caught it that way.

    Ho hum.
     
  4. Acord

    Acord New Member

    Joined:
    Jul 26, 2008
    Messages:
    1,217
    Likes Received:
    0
    I just figured out tonight that I'd been updating a map I spent all week on with an old version. DOH!
     
  5. Maupin

    Original Member

    Joined:
    Jun 28, 2006
    Messages:
    1,182
    Likes Received:
    0
    Man, I hate PHP. I use Python for exactly the same function, Desktop. Before I take it live I always test it with a string of the actual feed to make sure it's working. You could probably do something similar with PHP.

    Reflexive updates their game feed regularly, and I'm pretty sure they use it themselves to generate their own page. So if you see a new game on their site but it's not on yours - and your script has run - there's a problem somewhere.

    I have noticed that their orders XML feed is sometimes a few hours late. It's not unusual to see purchases listed in the Gamecenter control panel but not in the order XML feed, especially in the evenings around U.S. time.
     
  6. moose6912

    moose6912 New Member

    Joined:
    Jun 24, 2007
    Messages:
    219
    Likes Received:
    0
    That is what I always do when doing SQL stuff with PHP, just to catch errant SQL statement. It is times like these that I wished I was using ASP.NET instead, but PHP is so good for just to get simple stuff up and running real quick, plus I have not come across a reasonable priced webhosting account which supports ASP.NET.
     
  7. Indiepath

    Indiepath New Member

    Joined:
    Aug 22, 2004
    Messages:
    999
    Likes Received:
    0
    You are surely joking - PHP is king when it come to this kind of stuff...
     
  8. jankoM

    Indie Author

    Joined:
    Feb 17, 2005
    Messages:
    1,003
    Likes Received:
    0
    PHP is not really the beauty of a language but it functions and always shows errors, warnings and notices and parse time errors if it's set up to show them (or log them). As with all environments this stuff doesn't happen once you work with it for a while.

    If it was useless, megahogs like facebook, wikipedia, flickr, wordpress.. wouldn't be written in it (I am still amazed that they are :) )
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer