This is the problem a lot of people have with file extensions. Here is what you do:
1. Open a blank notepad.
2. Copy and paste the php text from the other failed one or just start over with a new one.
3. Go to File>Save As
4. Under "Save As Type" select All Files
5. Make the file name "whatever.php" without quotations.
5. Hit Save
And your done, this makes it an absolute php file, the encoding shouldn't matter, but to stay on the safe side, leave it as ANSI. I just tested this and I know it works, because instead of a text icon on the file, I have a Dreamweaver icon, which I have defaulted for php.
---EDIT---

Originally Posted by
dylan99379
<html>
<head>
<title>Online Scoreboard Tutorial - Scores</title>
</head>
<body>
<?
$service = "sql112.byethost13.com";
$username = "b13_1564643";
$password = "*******";
$database = "highscores";
mysql_connect($service, $username, $password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT * FROM highscores";
$result = mysql_query($query);
$num = mysql_numrows($result);
?>
<table>
<tr class="header"><td>Pos</td><td>Name</td><td>Score</td><td>Date Submitted</td></tr>
<?
$loopindex = 0;
while ($loopindex < $num) {
$thisname = mysql_result($result, $loopindex, "name");
$thisscore = mysql_result($result, $loopindex, "combatexperience");
$thisdate = mysql_result($result, $loopindex, "datesubmitted");
$thispos = $loopindex+1;
echo ("<tr><td align=left><p>$thispos</p></td>
<td align=center><p>$thisname</p></td>
<td align=center><p>$thisscore</p></td>
<td align=center><p>$thisdate</p></td></tr>\n");
$loopindex++;
}
?>
</table>
</body>
</html>
There is a problem in the php code right here at "$database = "highscores";" That is the table name, and the database should be something longer probably like bytehost12_highscore, you will find it in the phpMyAdmin. This line is correct
"$query = "SELECT * FROM highscores" because it uses the table name. If you fix the database thing you should be alright.