Don't you need to define the function before you call it?
function connectToDB()
{
$result = mysql_connect("freesql.org", "username", "password");
}
Then, call your function.
$conn = connectToDB();
But I think the parse error is because of your quotes. unless you're using username and password as variables (which you don't appear to be since you didn't use dollar signs), you need to put quotes around them.
$result = mysql_connect("freesql.org", "username", "password");
If they're variables, then you can
$result = mysql_connect("freesql.org", $username, $password);
Hope that helps.
Cgraz