First change <? to <?php
What's likely going on is you're getting a parse error, but your server is set to not display errors, so you just get a blank page. So add this to the top of your script after the PHP tags
// set the error_reporting level
error_reporting( E_ALL ^ E_NOTICE );
ini_set('display_errors', 1);
Now reload the page and you'll likely get a parse error along with a line number. I would guess the problem is occurring at the end of the first file you posted
echo "This is my field: ".$row[fieldname].";
should be
echo "This is my field: ".$row[fieldname];
There may be more, but this is the only error that really stood out to me at first glance.
As a sidenote: you don't need quotes surrounding the variables here
mysql_connect("$host", "$username", "$password") or die(mysql_error());