Fatal error in the output may indicate either your theme doesn’t like 3.1.2, you have a plugin that doesn’t like 3.1.2, or you have an incomplete upgrade.
So, try:
-deactivating ALL plugins temporarily to narrow down and possibly fix the problem. If the problem goes away, activate them individually (one-by-one) to find the problematic plugin.
If you don’t have access to your admin area, try deactivating them manually via FTP or phpMyAdmin.
-switching to the default theme (“twentyten”) for a moment by renaming your current theme’s folder in wp-content/themes. The idea is to force WordPress to fall back to the default theme to rule out any theme-specific issue.
If you don’t have access to your admin area, then access your server via FTP or SFTP or whatever file management application your host provides.
– resetting the plugins folder by FTP or phpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems (because the hooks remain unless plugins completely removed).
-If the above steps do not resolve the issue, download WordPress again and replace your copies of everything EXCEPT the wp-config.php file and the /wp-content/ directory with fresh copies. This should replace your core files without changing your content and settings in wp-config.php file and the /wp-content/ directory.
After you are done uploading the new files, point your browser to /wp-admin/upgrade.php