Displays PHP errors when enabled and mysql conn

Enabled error_reporting and display_errors in PHP if $display_errors is
enabled in settings. Also added a better error message for failing mysql
connections in index.php
Minimized amount of DOM-tree lookups.

jQuery use chainable methods, use it for better performance.