As far as the SQL table goes I would set an auto increment field then do an insert. That way you at what time and when the link was last clicked and the auto increment field will keep track of how many times the link is clicked. As per displaying the counter that depends on if you want it to display as just text similar to Gmail's MB counter, or have a cgi counter query the auto increment field and adjust itself accordingly.