Unless the person who downvoted answers here, it's not really possible to tell precisely.
In general - questions that are very specific to plugins are not overly favored. It's not that they are "bad" questions... But they are hard (or impossible) to answer without as specific expertise with that plugin. So they float around by hundreds and haunt site as unanswered.
Take it as someone didn't like the question, not as the whole site is out to get you.
I've neither up- nor down-voted the question, but if I were to down-vote, it would be due to question quality rather than scope*.
You state that the question has to do with
wpdb(), but you don't actually reference this function within your example code. Also, as @EAMann pointed out, you didn't describe your expected output, and how the actual output differs from expected. Thus, the question is rather difficult to answer, as-is.
*ironic, I know
Not entirely sure if this would be the best place to suggest something like this, but here it goes :)
In my short time being here I've seen several similar questions being asked. (also, I've seen several questions up and down voted for no apparent reason)
One of the solutions would of course be to simply moderate all votes. Or to have things listed somewhere, and make penalties when really needed.
But the easier, and more fair solution would probably be to include/force some kind of input field when voting.