I've tried both versions of ['firstname'] and ["firstname"] and that didnt seem to make a difference.
Also, I tried the SQL directly in php admin as you said and generated results there.
What's strange is when I run the full version of this with the result counting and such, it will actually show the counted results; but still not display the table information.
I'm thinking it might have to do with the while statement in this case, but I've checked this and it seems ok. Can anyone verify?