sql query: development versus production
Have you ever heard of a SQL query running fine in development, but returning an empty set in production? Usually that links to being an inconsistent data problem, but it’s the same data in this case—I’m confident that’s not it. I’m sure my local version of MySQL is newer than what’s in production, but that can’t be it, can it? Is that even something worth thinking about?
What an annoying turn of events. I don’t even know where to begin on this one.
UPDATE: fixed. From now on, any problem I have, no matter how small, I’m going to post it. Seems to be the fastest way to realize a solution.

Chris Thursday, 03 May, 2007 Posted at 12:54PM
Well, what was it???? :-p
Ryan Thursday, 03 May, 2007 Posted at 02:01PM
Shamefully, bad data.
When a person launches a topic, if it happens to be the first topic under that course, it starts tracking the overall course as well as that topic. That’s what I want to happen, but then when you look at the reports for a user, you couldn’t see what topics they’ve yet to complete, because they didn’t launch every topic, but rather only that first topic. So, when a user launches any topic in a course, if it’s the first of any topic being played, I’m inserting a record for all topics under that course for that user. That way, the reports show “(Not yet completed)” or whatever based on all topics for a course. It’s more complete that way.
I quickly realized this once I posted a version a week or two ago, and fixed it (but I was the one logged in, meaning my topics did not get recorded!) That’s why nothing was showing up for me (my user_id). It turns out that nothing was wrong with the query, or anything for that matter. Logging in with any other user who played content after the fix I had made last week, was fine.
Recap: “Usually that links to being an inconsistent data problem, but it’s the same data in this case—I’m confident that’s not it.”
Jeez.