I’ve Broken It!
I’ve been playing with my SQL queries all day and things were going great. I managed to get a couple of my pages from 54 SQL queries (n+2) down to just 4.
I had a really super sexy piece of SQL which looked like this:
Code:
SELECT distinct a.articleid, a.articleauthorid, a.articletitle, a.articlecontent, a.articledate, a.articleenclosuretitle, a.articleenclosureuri, a.articleenclosurelength, u.userid, u.username, u.userstatus, (SELECT COUNT(*) FROM comments WHERE comments.articleid = a.articleid)AS articlecomments FROM comments c, articles a, users u WHERE a.articleauthorid = u.userid AND u.userid = ‘.$userid.’ ORDER BY articledate DESC LIMIT 0,3; which did everything I wanted, got the article, its author details and had a colmun on the end indicating how many comments it had.
Untill…
I uploaded it to my web site from my local machine and it all went bang!! This shouldn’t happen, although there is a difference in the version of MySQL, my computer is running 3.23.49 and my web sites server is running 3.23.58.
I’m very unhappy about this but on the bright side, Claire is here to pick me up and we’re going for a BBQ at her house, woo. Cyas.