UnleashedCreativity.net
Postings on Mondays, Wednesdays, and Fridays or When-I-Have-Time-days

Login

username:
password:

Last 10 entries


Tags

.net 3d art blog c# coding college computers editorial entertainment firefox food freeware gaming hardware hdtp hiking humor ide japan japan, javascript linux mac mailbox milestone misc. mods momoiwa, mono movie nintendo philosophy php politics rant rebun review science software technology test time ucr wakkanai windows work wormholeftp 日本


Affiliates

  • Narcissism Incorporated
  • Wolfram Studios
  • KaleNet Web Design
  • OffTopic Productions
  • Deus Ex: High Definition Texture Project
  • The Nameless Mod


Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial 3.0 United States License.

TAKE THAT, TECHNOLOGY!

Posted on: Fri Jun 22, 2007 04:28 AM

Mad snaps, kudos, and props to EER and Danny! That's right, the problem I was having with the admin-side notes textbox was solved by none other than Erik and Danny!

To recap, about 6 months ago I created a textbox on the admin page that I could type up random snippits of my thoughts and ideas for future articles into. Despite the simplicity of such a system, I decided to integrate the note into the MySQL database. After all, how difficult would it be to update the one entry in the notes table every time I clicked a button? Little did I know that I would lose many hours of sleep in an attempt to figure out why something so simple could fail so horribly.

The problem I was having was when I clicked the Submit button, whatever value was in the Notes field would be completely erased. I could put a value into that field via PHPMyAdmin, but whenever I ran my script from my blog, the value would be deleted. At first I thought it might have been a problem with the structure of my MySQL query, so I echoed out the text that was being spit out to the MySQL UPDATE query. Nothing was wrong with my query; I could take it and run it through MySQL Query Browser, and it would work as I intended...so why was the value being deleted?!

For the next six months, I let that feature simmer on the back burner. I ended up sextuple-checking my code for errors, looking for anything that would affect the table, but nothing came up. My code was fine, my SQL query was well-developed...this problem should not have occurred, as it simply defied all programming logic.

Flash to today. A couple co-workers of mine (not Erik or Danny) tried solving the Case of the Mischievous Update and made the interesting discovery that the update query was running twice! Rather than use an UPDATE query, they used an INSERT query and every time they submitted the Notes textbox, two new rows would appear in the Notes table, one with the value in the textbox, and one blank one. Curioue, eh? After a couple hours (divided up over a couple days, yes we do get work done here!) of scouring my code, neither of them could find a reason why the MySQL query would submit twice.

Enter Erik and Danny. I explained to Erik the new findings, that the MySQL query was being run twice. Now, being the curious individual he is (and having an entire copy of my blog's codebase), he took it upon himself to figure out what exactly was causing the problem. Today, he finally figured out what had been causing the problem!

What was it that was messing with my Notes?

Any guesses?

I could give you 10 chances and you would get all of them wrong. Do you know why? Because you would NEVER guess that it was a JAVASCRIPT file causing the problem! Yes, a client-side Javascript file was somehow messing with a server-side MySQL query! Don't ask me how that works, since none of us, myself included, can see the logic behind that. Suffice to say that the site's Lightbox script was causing the problem, and after commenting out that javascript file from the header, the Notes box worked just as I had originally intended!

Thus ends one horrible and confusing chapter to the book that is Unleashed Creativity's Development! Were it not for the ingenuity of Erik and his cohort Danny, I would most likely still be struggling with this problem, but now, I can move onto bigger and better things, like FLAT-FILING THE NOTES INSTEAD OF TAKING UP SPACE IN A MYSQL DATABASE FOR SUCH AN INSIGNIFICANT AMOUNT OF INFORMATION!


By EER @ Fri Jun 22, 2007 04:31 AM

woohoo, we rule! :P

By Danny @ Fri Jun 22, 2007 04:50 AM

Yeah... that was one crazy problem :D

Leave a Comment









EVERYTHING on this site is © Matthew Miller, 2005-2010, so don't friggin' touch