Fixed excessive memory usage errors in export script that caused timeouts in exports.  Also changed login query die() parameter to be mysql_error() for more verbose error message.