Ok, thank you
. It is to say that the variable $gid shouldn't be in the query at all.

In most online communities, 90% of users are lurkers who never contribute, 9% of users contribute a little, and 1% of users account for almost all the action.