update database query and web cgi entry