Tweaked Error Logging with SQL

Fixed a copy/paste error from a previous project which used MySQL