Posts Tagged ‘MySQL’

Database Query Upgrade

September 30th, 2008 1:23am No comments

Coming soon. TH12’s postseason picks!

So you didn’t realize it, but there has been an error in a SQL query I have been using since I launched the website redesign two years ago. To be frank, it is all fixed – you didn’t notice anything wrong (it was a backend issue that affected me badly when I was posting). This fix makes my life a lot easier. If you’re interested in the geek behind it, read on. Not so technical? You better quit while you’re still with me.

Ok, ubergeek interested in the inner-workings of this site, here goes: Back in the day, the homepage was a WordPress theme, that was customized to match my site template. When I decided to make my site XHTML strict, so the theme hacks would never work. As a result, I moved the blog to a subdomain and threw in a new layout for the main site. To get my news to the front page, I used a SQL query to the WordPress Database. Here is where the problem arose. It would query the last story in the database, whether it was marked as draft or published. I was working on an epic new post that is not ready for the public yet, and it really annoyed me that the draft of it was being fed onto my main page! How insecure to ignore the fact that it hasn’t been published yet. Well, at 2:23AM when there is homework due for a 9:30AM class, people like me start programming to fix these things. I dove right into the SQL queries until I found one that works, sorted it out for the site and “boom, there goes the dynamite.”

Categories: Website Related Tags: