for the first question:
SELECT country_column, count(*) AS cnt
FROM table
GROUP BY country_column
ORDER BY country_culumn
For the second, you'll need a way of letting users log-on.
Have a look at sessions, there are plenty of helpfull hints in the forum about user-login logout systems.