Fixed bug #profile.php#1

Bug description:
	Local testing server works fine when viewing profile, but remote
	beta-testing tells on every user that his profile/record does not
	exists also when it really does.

Bug fix:
	Database connection directive moved to the top of file.

Bug reason:
	PHP's native mysql_real_escape_string() function can be called with two
	arguments instead of one. The first argument is string to escape,
	and the second is MySQL connection resource identifier (namely
	$link). If it is not passed (the $link argument), this function
	tries to use last opened connection and if it can not find one, it
	tries to connect with ''@localhost. On local server, this can be
	set for multiple connections possibility, without need of creating
	extra MySQL accounts.
	Problem was, that mysql_real_escape_string() succeeds with this
	third case on my local testing server, but on remote beta testing
	didn't.