Che c'entra WHERE email=%S?
SELECT uid FROM calendar_users WHERE username=$colname_countusers